I want to hide a DIV element after the previous effects/movements have completed. If I knew the sequence I could just add code to callback function that I give to .animate() (for example). However in this situation I don’t have access to that state (it may or may not be going through an animation/effect). So the two animations/effects are triggered by two different events (button clicks for example).
So I would run fadeOut after the DIV element has finished the current animation/effect. Is this possible with jQuery?
Thanks.
EDIT: So the target is to decouple the current action (fadeOut() for example) code from the previous animation code.
EDIT2: Made the question more clear.
Just call
.fadeOut()and it will automatically be added to the end of the fx queue:http://jsfiddle.net/gilly3/f4vNH/