Elements can be considered hidden for several reasons:
- They have a CSS
display
value of none
.
- They are form elements with
type="hidden"
.
- Their width and height are explicitly set to 0.
- An ancestor element is hidden, so the element is not shown on the page.
the image does not satisfy any of those conditions. I highlighted the 3rd one because I don't believe that this is what really is happening in the jquery code.
Here is the function responsible for that:
return (elem.offsetWidth === 0 && elem.offsetHeight === 0) ||
(!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || curCSS(elem, "display")) === "none");
as we can see it doesn't check if width and height are explicitly set to 0 like it's stated in the documentation. which is rather confusing.
I don't know if it's a bug in the functionality or just the documentation should be more clear about that.