How to repeat animation on complete using jQuery's animate() function?
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);
})();
精彩评论