X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Ffx.js;h=c613f938dad3dbe58fa5ad328067ccc6bb5c2f6e;hb=58c640fb1ce09a03399a3a441716cca23f3f2d04;hp=b35dbcd8d736c49ce8f20f4e44b32dba2ec31c15;hpb=5039a4bc5b951b9d28659f6f42f73c59e2e560fc;p=jquery.git diff --git a/src/fx.js b/src/fx.js index b35dbcd..c613f93 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; @@ -135,6 +139,9 @@ 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 { @@ -411,4 +418,4 @@ jQuery.fx.step = { _default: function(fx){ fx.elem.style[ fx.prop ] = fx.now + fx.unit; } -}; +}; \ No newline at end of file