jquery动画问题
我需要修改 这个 插件以旋转图像而不等待动画结束。如果您访问该链接,您可能会注意到动画在上一个动画结束时重新启动,但我希望图像背靠背,所以我不想等待第一个动画结束才能开始下一个动画。知道如何做到这一点。该插件的相关代码片段是
el.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 ;
});
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
el.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 ;
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你必须以完全不同的方式来处理这个问题。您要么必须复制所有图像并使用两个容器,因为其中一个容器完全隐藏,请将其移至右侧,或者将图像从左侧弹出,然后在它们从页面消失时将它们添加到右侧。
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.