I’m trying to create a carousel effect that automatically cycles through each pictures every 3 seconds.
$(".headline_img").each(function(intIndex){
setTimeout($(this).show(),3000);
});
The timeout delay is not working.
This shows all of the images instantly as soon as the dom loads. It’s like its ignoring the setTimeout function.
Did I miss something?
Note: I’m calling this using $(document).ready, do you think that might effect it?
The
setTimeoutfunction takes a function reference or a string. Your code calls theshowmethod for each element immediately. I’m not sure if this will work:but it’s worth a try…