我想要暂停和恢复这个jquery动画

时间:2011-02-18 09:41:20

标签: javascript jquery

$(document).ready(function() {
    setTimeout("wave()", 0);
});

function wave(){
$("#wave1")
    .animate({left:"100px", top:"400px" },2000) 
    .animate({left:"200px", top:"0px" },2000) 
    .animate({left:"300px", top:"400px" },2000) 
    .animate({left:"400px", top:"0px" },2000) 
    .animate({left:"500px", top:"400px" },2000) 
    .animate({left:"600px", top:"0px" },2000) 
    .animate({left:"500px", top:"400px" },2000) 
    .animate({left:"400px", top:"0px" },2000) 
    setTimeout("wave()")
} 

有没有办法在jQuery中以某种方式暂停/恢复我的动画?

1 个答案:

答案 0 :(得分:2)