X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Ffx.js;h=b4606a82fc49250a6effe0adaafdfe9ab1ca5614;hb=fde3d616ac3d8efe822c6dbf23d7659b00fc54b1;hp=b35dbcd8d736c49ce8f20f4e44b32dba2ec31c15;hpb=5039a4bc5b951b9d28659f6f42f73c59e2e560fc;p=jquery.git diff --git a/src/fx.js b/src/fx.js index b35dbcd..b4606a8 100644 --- a/src/fx.js +++ b/src/fx.js @@ -6,9 +6,12 @@ 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"); + elem.remove(); + } }).end(); }, @@ -20,8 +23,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 +70,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,7 +178,7 @@ jQuery.fn.extend({ var queue = function( elem, type, array ) { if ( !elem ) - return; + return undefined; type = type || "fx";