var div = $("div");
one(),two(),three()
function one() {div.css("background", "#f00").hide().fadeIn(1000)};
function two() {div.css("background", "#ff0").hide().fadeIn(1000)};
function three() {div.css("background", "#000").hide().fadeIn(1000)};
Any plugin like
$.stepz(one(),1);
$.stepz(two(),2);
$.stepz(three(),3);
???
Both
cssandhideare executed immediately, so you don’t need to wait for anything there.fadeInon the other hand needs some time to complete, so that is what you wanna wait for. You can pass a callback function that gets called when the animation is complete:http://jsfiddle.net/ckC9d/