Simple question: How does jQuery know what display mode an element should use when using fadeIn?
What I mean, is that it appears to use the proper display mode for any element that I fadeIn, even when I set display:none initially in my CSS – images are using inline, divs are using block, etc.
I looked into the jQuery source code on GitHub, but I couldnt locate what I was looking for.
Reason I ask is because I am making a little plugin myself, using fade (but with Animate, since there is more than 1 property that needs animation).
It uses
$.datato store it:The underscore means that it can access data that is not normally available through
$.dataor$.fn.data. Basically this is for internal use only and you should not touch it.If the element is set to
display:nonethrough CSS, and you fade it in, jQuery still knows to make itinlineetc. In this case, it uses the functionWhich would give
"inline"for anodeName === "span"