Bug Tracker

Opened 16 years ago

Closed 16 years ago

#1518 closed bug (fixed)

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 );
 			});

Change History (2)

comment:1 Changed 16 years ago by john

Owner: set to john

comment:2 Changed 16 years ago by john

Resolution: fixed
Status: newclosed

Fixed in SVN rev [2832].

Note: See TracTickets for help on using tickets.