$.fn.show() not working on visibility:hidden is a bug, not a feature
Hi people,
I once again want to get attention for what I consider a flaw in
jquery. It's been addressed several times and can be found here with
references to earlier posts:
http://groups.google.com/group/jquery-dev/browse_thread/thread/d77c38d197368e89/4883dd2e85689dc8?hl=en#4883dd2e85689dc8
The problem is built into the $.fn.show() function, which ignores the
CSS property visibility, but only works on display: none;. Even to
those who believe this is design, a choice or a feature (I haven't
found ANY plugin as of yet, relying on this 'feature', as my personal
version of jquery contains a patch so it DOES consider visibility and
works with all the plugins I've used in the last year), it should
appear slightly odd and misplaced that $.fn.show() uses:
'this.filter(":hidden")'
To check for hidden elements, where ':hidden' checks for:
jQuery.css(a,"display")=="none"||
jQuery.css(a,"visibility")=="hidden"',
And afterwards visibility is ignored? To me, having .show() work on
visibility is both intuitive (I want to show a hidden element!) and
extremely useful, as sometimes one cannot set the 'display' property
because the dimensions cannot be calculated that way, or for other
reasons. It doesn't mean we don't want to be able to 'show' the
element later on, as little as display: none says we wouldn't want to
show the element any longer at any time.
I hope this is not again an idle call in the darkness.
Please don't tell me to open a ticket, as it's there already:
http://dev.jquery.com/ticket/2029
Cheers!
Yereth