diff options
author | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-06-24 10:00:42 +0000 |
---|---|---|
committer | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-06-24 10:00:42 +0000 |
commit | b5d65d4e4920d0a09bb53504cca7c21033ea8790 (patch) | |
tree | 71c15844dc521cbc217a12ee78fe5c4b1b37514c /src/fx.js | |
parent | 4812446594645b0a431b66507595afd3331e3292 (diff) | |
download | jquery-b5d65d4e4920d0a09bb53504cca7c21033ea8790.tar.gz jquery-b5d65d4e4920d0a09bb53504cca7c21033ea8790.zip |
fx: 1) patch from Ariel removes the need of adding properties like scrollTop and scrollLeft specifically to fx.step - The priority order is style[prop] ? style[prop] : elem[prop], 2) fixed the height/width case - it wasn't possible to animate obj.height/obj.width if there wasn't a style attr.
Diffstat (limited to 'src/fx.js')
-rw-r--r-- | src/fx.js | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -82,7 +82,7 @@ jQuery.fn.extend({ if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden ) return opt.complete.call(this); - if ( p == "height" || p == "width" ) { + if ( ( p == "height" || p == "width" ) && this.style ) { // Store display property opt.display = jQuery.css(this, "display"); @@ -264,7 +264,7 @@ jQuery.fx.prototype = { (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this ); // Set display property to block for height/width animations - if ( this.prop == "height" || this.prop == "width" ) + if ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style ) this.elem.style.display = "block"; }, @@ -407,20 +407,16 @@ jQuery.extend( jQuery.fx, { _default: 400 }, step: { - scrollLeft: function(fx){ - fx.elem.scrollLeft = fx.now; - }, - - scrollTop: function(fx){ - fx.elem.scrollTop = fx.now; - }, opacity: function(fx){ jQuery.attr(fx.elem.style, "opacity", fx.now); }, _default: function(fx){ - ( fx.elem.style && ( fx.elem.style[ fx.prop ] = fx.now + fx.unit ) ) || ( fx.elem[ fx.prop ] = fx.now ); + if( fx.prop in fx.elem ) + fx.elem[ fx.prop ] = fx.now; + else if( fx.elem.style ) + fx.elem.style[ fx.prop ] = fx.now + fx.unit; } } }); |