I made a very simple plugin for my personal use that allows animated rotations in jQuery.
And I added callback functions.
If the rewind
parameter is true
, the rotation is undone and then, a callback.
If it's false
, the callback is immediate after the rotation.
I had to do this because, for some reason, the .promise().done(function(){ ... })
is called before complete:
of animate()
So I had to skirt this.
Now the problem is that if I target multiple elements, the callback is called for each element. 'cause I use an each
function I presume. But I want only one callback for the whole animation.
Here is the fiddle
How to do this please? Thx !
PS: I saw a similar question here : jQuery $.animate() multiple elements but only fire callback once but not applying because of the .promise().done()
issue. And I don't want to add a variable, I want to understand ^^