I’m trying to figure out how I can do something (alert) when all the stuff has finished fading in. Maybe my syntax is not good?
$.fn.showdelay = function(){
var delay = 0;
return this.each(function(){
$(this).delay(delay).fadeIn(200);
delay += 200;
},
function(){
alert('done!');
});
};
$item.delay(500).showdelay();
Utilize the
callback function parameterin thefadeInmethod:http://api.jquery.com/fadeIn/