X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=src%2Feffects.js;h=130b676f42b3252ddcfaea483e85c5ec28c924f1;hb=194c93eca2c3cfccbf74236587537d9892d88b1d;hp=40326e23da1b9a2a5f30b0bae31490bb82b2bfee;hpb=b3ccf2f2881d9ad988aba1cf3ccffb810063ab29;p=jquery.git diff --git a/src/effects.js b/src/effects.js index 40326e2..130b676 100644 --- a/src/effects.js +++ b/src/effects.js @@ -1,3 +1,5 @@ +(function( jQuery ) { + var elemdisplay = {}, rfxtypes = /toggle|show|hide/, rfxnum = /^([+\-]=)?([\d+.\-]+)(.*)$/, @@ -64,7 +66,7 @@ jQuery.fn.extend({ for ( var i = 0, l = this.length; i < l; i++ ) { var old = jQuery.data(this[i], "olddisplay"); if ( !old && old !== "none" ) { - jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display")); + jQuery.data( this[i], "olddisplay", jQuery.css(this[i], "display") ); } } @@ -314,8 +316,8 @@ jQuery.fx.prototype = { return this.elem[ this.prop ]; } - var r = parseFloat(jQuery.css(this.elem, this.prop, force)); - return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0; + var r = parseFloat(jQuery.css(this.elem, this.prop, undefined, force)); + return r && r > -10000 ? r : parseFloat(jQuery.css(this.elem, this.prop)) || 0; }, // Start an animation from one number to another @@ -342,7 +344,7 @@ jQuery.fx.prototype = { // Simple 'show' function show: function() { // Remember where we started, so that we can go back to it later - this.options.orig[this.prop] = jQuery.style( this.elem, this.prop ); + this.options.orig[this.prop] = jQuery.css( this.elem, this.prop ); this.options.show = true; // Begin the animation @@ -357,7 +359,7 @@ jQuery.fx.prototype = { // Simple 'hide' function hide: function() { // Remember where we started, so that we can go back to it later - this.options.orig[this.prop] = jQuery.style( this.elem, this.prop ); + this.options.orig[this.prop] = jQuery.css( this.elem, this.prop ); this.options.hide = true; // Begin the animation @@ -403,7 +405,7 @@ jQuery.fx.prototype = { // Reset the properties, if the item has been hidden or shown if ( this.options.hide || this.options.show ) { for ( var p in this.options.curAnim ) { - jQuery.style(this.elem, p, this.options.orig[p]); + jQuery.css( this.elem, p, this.options.orig[p] ); } } @@ -460,7 +462,7 @@ jQuery.extend( jQuery.fx, { step: { opacity: function( fx ) { - jQuery.style(fx.elem, "opacity", fx.now); + jQuery.css( fx.elem, "opacity", fx.now ); }, _default: function( fx ) { @@ -480,3 +482,5 @@ if ( jQuery.expr && jQuery.expr.filters ) { }).length; }; } + +})( jQuery );