开发者

jQuery - After animation ends change background

I have an click event that is making my DIV move and change the background position

$("a.clickme").click(
function(){
$("#moveme").animate({left: -550 +"px"}, 2000);
$('#moveme').animate(2000).css({backgroundPosition: '0 -1px'});
});

It works like this to, but I need something that will make the background position change after the "move" (left: -550) is done. Can you help me? T开发者_运维百科hank you!


use callback, .animate()

$("#moveme").animate({left: -550 +"px"}, 2000, function(){
    // codes here after the animation....
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜