X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Ffx.js;h=64cfbc62525123464d6c570772d27d9887375169;hb=d36382e9a3fa604597d400d1084a2424f0d3eb80;hp=52225c8a4d6bbac42b068c6c85bc15f8000aaa93;hpb=ffbedf0262b3eea906f39c0115b818d7456a3994;p=jquery.git diff --git a/src/fx.js b/src/fx.js index 52225c8..64cfbc6 100644 --- a/src/fx.js +++ b/src/fx.js @@ -6,9 +6,15 @@ jQuery.fn.extend({ }, speed, callback) : this.filter(":hidden").each(function(){ - this.style.display = this.oldblock ? this.oldblock : ""; - if ( jQuery.css(this,"display") == "none" ) - this.style.display = "block"; + 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(); }, @@ -20,8 +26,6 @@ jQuery.fn.extend({ this.filter(":visible").each(function(){ this.oldblock = this.oldblock || jQuery.css(this,"display"); - if ( this.oldblock == "none" ) - this.oldblock = "block"; this.style.display = "none"; }).end(); }, @@ -138,9 +142,6 @@ jQuery.fn.extend({ return queue( this[0], type ); return this.each(function(){ - if ( this.nodeType != 1) - return; - if ( fn.constructor == Array ) queue(this, type, fn); else { @@ -180,7 +181,7 @@ jQuery.fn.extend({ var queue = function( elem, type, array ) { if ( !elem ) - return; + return undefined; type = type || "fx";