2012-04-10 3 views

답변

2

체인 애니메이션 :

$('.my_element').animate(...first destination...) 
       .animate(...second destination...) 
       .animate(...third destination...) 
       .animate(...fourth destination...) 

당신은 또한 그것을 배열에서 대상을 저장하고, 루프 수 있습니다.

var destinations = [ 
     {top:..., left:...}, 
     {top:..., left:...}, 
     {top:..., left:...}, 
     {top:..., left:...} 
    ], 
    element = $('.my_element'); 

$.each(destinations, function(i, v) { 
    element.animate(v) 
}); 

Here's your code 약간 수정되었습니다.

관련 문제