$.fn.show() bug

$.fn.show() bug


Hi people,
once again I want to get attention for the .show() function, which
doesn't work on visibility:hidden.
I reopened the ticket on jquery.com:
http://dev.jquery.com/ticket/2029
If you care to see for yourself whether an adjusted .show() function
works, try Yereth flavoured jquery:
http://www.yereth.nl/js/jquery-1.2.2-yereth.js
I think it is rather intuitive that .show() doesn't have any
restrictions on what kind of hiding is going on. Besides that, my
version of jquery with an adjusted .show function works fine with all
used plugins. Also, I have seen more destructive changes in jquery
releases before. I can't use the regular taste of jquery, as my
plugins depend on .show() working on visibility: hidden. Some
calculations are more easily done on hidden elements than on display:
none elements. You might say: detect which is used, then use show()
or .css(), but the funny thing is that the selectors :hidden
and :visible DO work on visibility. Quite interesting, as .show() is
using those exact selectors. Take a look:
Taken from the .show function:
this.filter(":hidden").each(function(){
this.style.display = this.oldblock ||
"";
if ( jQuery.css(this,"display") ==
"none" ) {
var elem = jQuery("<" +
this.tagName + " />").appendTo("body");
this.style.display =
elem.css("display");
// handle an edge condition
where css is - div { display:none; }
or similar
if (this.style.display ==
"none")
this.style.display =
"block";
elem.remove();
}
}).end();
The :hidden and :visible selectors:
visible: '"hidden"!
=a.type&&jQuery.css(a,"display")!
="none"&&jQuery.css(a,"visibility")!="hidden"',
hidden: '"hidden"==a.type||
jQuery.css(a,"display")=="none"||
jQuery.css(a,"visibility")=="hidden"',
I find this very interesting, but throughout the last months, I seem
to be the only one to notice. Do all of you just work around the
problem of the .show() function? As far as I know, no one is actually
utilizing the 'feature' defended in earlier posts.
Please reconsider the change! If you are sceptical, try it for
yourself:
http://www.yereth.nl/js/jquery-1.2.2-yereth.js
Try it with all your plugins and think of the logic of either ways of
treating the .show(). It bothers me not being able to use the regular
releases.
Thanks a lot.
Yereth