A simple question: how does jQuery know which display mode the element should use when using fadeIn?
What I mean is that it seems to use the correct display mode for any element that I fadeIn, even when I set it display:none initially in my CSS images using inline divs using a block, etc.
display:none
I looked at jQuery source code on GitHub, but I could not find what I was looking for.
The reason I'm asking for is because I myself create a small plugin using fade (but with Animate, since there is more than one property that needs animation).
$.data, :
$.data
console.log($._data( elem, "olddisplay" ));
, , $.data $.fn.data. , .
$.fn.data
display:none CSS, , jQuery , inline ..
inline
// Try to determine the default display value of an element function css_defaultDisplay( nodeName ) {
"inline" a nodeName === "span"
"inline"
nodeName === "span"