You can simply use .hide() to stop it from fading and instantly hide it.
If you need to find that it disappears without stopping the fading, it becomes more complex.
The easiest way to detect it without changing it is to use .data to set the value for an element that indicates that it is currently disappearing.
Then, if your call is .fade , use a callback that removes this value, for example:
element.data('fading', true); element.fade(5000, function() { $(this).data('fading', false); });
Then you can check if it is really fading out using:
if(element.data('fading'))
Alan geleynse
source share