X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Ffx.js;h=824616afbb75d015d967846165398ecd05318158;hb=25f9974cee5874d10df32f2d16fb985181e0c077;hp=b35dbcd8d736c49ce8f20f4e44b32dba2ec31c15;hpb=5039a4bc5b951b9d28659f6f42f73c59e2e560fc;p=jquery.git diff --git a/src/fx.js b/src/fx.js index b35dbcd..824616a 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(); }, @@ -69,6 +73,9 @@ jQuery.fn.extend({ var optall = jQuery.speed(speed, easing, callback); return this[ optall.queue === false ? "each" : "queue" ](function(){ + if ( this.nodeType != 1) + return false; + var opt = jQuery.extend({}, optall); var hidden = jQuery(this).is(":hidden"), self = this; @@ -174,15 +181,14 @@ jQuery.fn.extend({ var queue = function( elem, type, array ) { if ( !elem ) - return; + return undefined; type = type || "fx"; var q = jQuery.data( elem, type + "queue" ); if ( !q || array ) - q = jQuery.data( elem, type + "queue", - array ? jQuery.makeArray(array) : [] ); + q = jQuery.data( elem, type + "queue", jQuery.makeArray(array) ); return q; };