jQuery: The Write Less, Do More JavaScript Library

Ticket #1518 (closed bug: fixed)

Opened 1 year ago

Last modified 1 year ago

Error in IE when animating undefined properties

Reported by: malsup Assigned to: john
Type: bug Priority: major
Milestone: 1.1.4 Component: fx
Version: 1.1.3 Keywords: animate
Cc: Needs: Review

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

Attachments

Change History

Changed 1 year ago by john

  • owner set to john

Changed 1 year ago by john

  • status changed from new to closed
  • resolution set to fixed

Fixed in SVN rev [2832].

Note: See TracTickets for help on using tickets.