开发者

jQuery - After animation ends change background

开发者 https://www.devze.com 2023-02-05 12:44 出处:网络
I have an click event that is making my DIV move and change the background position $(\"a.clickme\").click(

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

精彩评论

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

关注公众号