I am having trouble with an image animation and cant seem to figure it out.
<div id="img_loop">
<img src="img/img1.jpg" alt="image1" />
<img src="img/img2.jpg" alt="image2" class="hidden" />
<img src="img/img3.jpg" alt="image3" class="hidden" />
</div>
Two of the images have the class of hidden which sets their css display=none;
I have these three images and want to do a continuous loop by switching between them being in the class 'hidden' so that its a slide of the three images where only one at a time is not hidden.
I was trying somthing along these lines
$(function(){
setInterval("updateImage()", 2500);
})
function updateImage() {
var $active = $('#img_loop img').not('hidden');
var $next = $active.next();
$active.fadeTo(1000, 1.0, function(){
$active.addClass('hidden');
$next.removeClass('hidden')
})
}
Thanks for all the help :)