You can make a custom jQuery selector for it
(function($) { var endOpacity, oldStep = jQuery.fx.step.opacity; $.fx.step.opacity = function( fx ) { endOpacity = fx.end; return oldStep(fx); }; $.expr[':'].hiding = function(obj){ var $this = $(obj); return ($this.is(':hidden') || ($this.is(':animated') && endOpacity === 0)); }; })(jQuery);
This worked for me (this may require a little more testing).
So just add :hiding , this will match the hidden elements and elements that are currently animating up to 0. Now there will only be matching elements that disappear rather than appear.
alex
source share