2012-04-10 21 views

Antwort

2

Kette der Animationen:

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

Sie auch die Ziele in einem Array und Schleife es speichern kann.

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 überarbeitet ein wenig.

Verwandte Themen