开发者

jquery animate problem

I need to modify this plugin to rotate images without waiting for animation to end. If you visit that link you might notice that animation restarts at the the end of previous animation but i want images back to back so i dont want to wait for end of the first animation to start next one. Any idea how to do that. Relevant code snippet from that plugin is

e开发者_如何学Gol.animate({ left:"-" + el.width() + "px" }, time, "linear", function() {

//reset container position
$(this).css({ left:$("div#imageScroller").width(), right:"" });

//restart animation. Problem is to restart it when last image completey appears with out pausing current animation.
animator($(this), duration, "rtl");

//hide controls if visible
($("div#controls").length > 0) ? $("div#controls").slideUp("slow").remove() : null ;

}); 


You'd have to approach this completely differently. You'd either have to duplicate all the images and use two containers and as one is completely hidden, move it to the right or pop images off the left side and add them to the right side as they disappear off the page.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜