wandoledzep/bxslider — Issue #89: bxslider breaks jQuery.animate() in IE < 9
Author: PhilippSoehnlein
Created: 2012-02-08 08:37:09+00:00
State: open

If bxslider is included in a webpage that includes another module which uses [jQuery.animate()](http://api.jquery.com/animate/), the other module may break.

Here is a reduced testcase:
http://jsbin.com/iluwus/11

Here is the same version in which bxslider isn't included (this one works):
http://jsbin.com/iluwus/9

IE < 9 throws an "Invalid argument" exception, because there is a NaN applied to the animated objects top coordinate in jQuery.fx.step._default:
```javascript
fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
```

This happens because bxslider overwrites the jQuery.fx.prototype.cur function and skips the additional check that the original jQuery function does:
```javascript
// Get the current size
cur: function() {
if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
return this.elem[ this.prop ];
}

var parsed,
r = jQuery.css( this.elem, this.prop );
// Empty strings, null, undefined and "auto" are converted to 0,
// complex values such as "rotate(1rad)" are returned as is,
// simple values such as "10px" are parsed to Float.
return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
},
```