开发者

How to repeat animation on complete using jQuery's animate() function?

开发者 https://www.devze.com 2023-03-30 14:02 出处:网络
Here\'s my code. How to get the animation to repeat every time it completes? $(\'img.balloon\').animate({

Here's my code. How to get the animation to repeat every time it completes?

$('img.balloon').animate({
     bottom : '100%'
}, 开发者_StackOverflow中文版4000, 'linear', function() {
     // on complete repeat but how?
});


(function doAnim(){
    $('img.balloon').css('bottom', '-20px').animate({
         bottom : '100%'
    }, 4000, 'linear',
    doAnim);
})();
0

精彩评论

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