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....
});
精彩评论