Came across this problem whereby width/height animation in Opera, of
an object that has a border, causes 'jumps' in the object size before resizing.
Demo and fix : http://www.wizzud.com/tester/operabug.html
This occurs because the borders are being included in the starting
width and height when initialising the animation. The problem is
located in fx.cur(), when curCSS() is used to get the width/height
values.
I can only find this problem in Opera (tried IE6, IE7, FF1.5, FF2,
Safari 2, Safari 3beta).
I have a rough patch (see below and demo) that fixes it, based on the theory that if width() and height() are the standard API methods for determining those particular values then why should animate() not use them too.
/* THE FIX : ...*/
jQuery.fx.prototype.cur = function(force){
if ( this.elem[this.prop] != null && this.elem.style[this.prop] == null )
return this.elem[ this.prop ];
//wizzud...(opera screws up animation with borders)...inserted
if( this.prop == 'width'
this.prop == 'height')
return parseFloat(jQuery.css(this.elem, this.prop));
//wizzud...end of insert
var r = parseFloat(jQuery.curCSS(this.elem, this.prop, force));
return r && r > -10000 ? r : parseFloat(jQuery.css(this.elem, this.prop)) 0;
};
Attachments
Change History
Download in other formats:
| |