Callback of .animate() gets called twice jquery
To get a single callback for the completion of multiple element animations, use deferred objects. $(“.myClass”).animate({ marginLeft: “30em” }).promise().done(function(){ alert(“Done animating”); }); When you call .animate on a collection, each element in the collection is animated individually. When each one is done, the callback is called. This means if you animate eight elements, you’ll get … Read more