nbccit
asked on
Loop chained effects in jQuery
Hi.
I am attempting to create a loop of elements that fade in and out (ie, a slideshow). I understand how to use the callback function to control the timing of the fades, but how do i loop this?
It feels like a infinite regression.
Thanks,
Chip
I am attempting to create a loop of elements that fade in and out (ie, a slideshow). I understand how to use the callback function to control the timing of the fades, but how do i loop this?
It feels like a infinite regression.
Thanks,
Chip
$(document).ready(function(){
$('div#slideshow').children().hide();
fadeElement('div#slide1', function(){fadeElement('div#slide2');});
});
function fadeElement(elementName, f){ $(elementName).fadeIn(3000).delay(2000).fadeOut(3000, f);
return;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sounds like that is the way to go. Thanks.