This might be a simple solution, but I haven’t been able to find anything anywhere.
In my code I’m doing:
$('#animateObject').animate({
'position': 'absolute',
'height': thisWidgetSettings.detailHeight,
width: thisWidgetSettings.detailWidth,
marginTop: '-120px',
marginLeft: '-320px',
top: $(window).height() / 2 - (parseInt(thisWidgetSettings.detailHeight, 10) / 2) + 120 + $(window).scrollTop(),
left: $(window).width() / 2 - (parseInt(thisWidgetSettings.detailWidth, 10) / 2) + 320 + $(window).scrollLeft()
}, 500);
In IE9, Safari, Firefox, and Chrome, this all works great and does exactly what I want. However, in IE7 and IE8, the line below is causing errors.
// JQuery 1.7.2 Line 8938
this.now = this.start + ( (this.end - this.start) * this.pos );
}
this.update();
I believe the reason for this error is that at this point this.now gets set, and if the values passed in are not numeric, this.now ends up being something like “absoluteNaN” causing the update function to fail. Am I passing something in to the animate object incorrectly or is this a problem with JQuery?
The reason for this is because “animate” doesn’t work on non-numeric values, such as ‘-320px’. Passing in ‘-320’ instead works just fine.