jQuery: interrupting fadeIn()/fadeOut()
Let's say I've called $element.fadeIn(200). 100 ms later, something happens on that page and I want to interrupt that fade and immediately fadeOut(). How can I do this? If you call calling $element.fadeIn(200).fadeOut(0), the fadeOut() only happens after the fadeIn() has finished. Also, is there a way I can examine $element to determine if a fadeIn() or fadeOut() is running? Does $element have any .data() member that changes? stop() will only remove animations that are not executed yet. use stop(true, true) to interrupt and remove the current animation too! You will get smooth fadeIn/Out