In my application $element.css("margin-top") was returning "auto" in IE, which causes parseInt to return NaN. Later on when that value is used as originalMargin within getMargin somewhere IE would raise an error. My change prevents the error by ensuring originalMargin is a number. I also pass the base (10) to parseInt to avoid any issues like this: http://stackoverflow.com/questions/850341/workarounds-for-javascript-parseint-octal-bug
In my application $element.css("margin-top") was returning "auto" in IE, which causes parseInt to return NaN. Later on when that value is used as originalMargin within getMargin somewhere IE would raise an error. My change prevents the error by ensuring originalMargin is a number. I also pass the base (10) to parseInt to avoid any issues like this: http://stackoverflow.com/questions/850341/workarounds-for-javascript-parseint-octal-bug