Side navigation
#1518 closed bug (fixed)
Opened August 20, 2007 01:08PM UTC
Closed August 22, 2007 04:53AM UTC
Error in IE when animating undefined properties
Reported by: | malsup | Owned by: | john |
---|---|---|---|
Priority: | major | Milestone: | 1.1.4 |
Component: | effects | Version: | 1.1.3 |
Keywords: | animate | Cc: | |
Blocked by: | Blocking: |
Description
Yes, I know you shouldn't animate undefined props! But a minor change can prevent IE from borking when this happpens.
Sample file which shows the error:
<html> <head> <script type="text/javascript" src="../rel/jquery-1.1.3.1.js"></script> <script type="text/javascript"> $(function() { $('body').animate({top: 50}, 'fast'); }); </script> </head> <body><div></div></body> </html>
This change to fx.js will fix the problem:
Index: fx.js =================================================================== --- fx.js (revision 2783) +++ fx.js (working copy) @@ -336,7 +336,7 @@ jQuery.each( prop, function(name, val){ var e = new jQuery.fx( self, opt, name ); if ( val.constructor == Number ) - e.custom( e.cur(), val ); + e.custom( e.cur() || 0, val ); else e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop ); });