The problem is that jQuery only performs functions like fadeIn if the item is not displayed. jQuery internally executes $(this).is(':hidden') to decide whether to run the animation. The hidden filter does not explicitly check if opacity is 0; it probably should be.
The obvious solution is to set display: none , as you have, or call hide() before calling fadeIn() , if you are sure that the element is hidden.
Another solution is to override the hidden filter to check for opacity:
jQuery.expr.filters.hidden = function(elem) { var width = elem.offsetWidth, height = elem.offsetHeight; return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css(elem, "display")) === "none" || (elem.style.opacity || jQuery.css(elem, 'opacity')) === "0"); };
Running .is(':hidden') now checks for opacity. See jsFiddle .
I logged a bug report to cover this issue.
lonesomeday
source share