Ticket #10582 (closed bug: wontfix)
Invalid argument on line 8602 in jQuery 1.6.4 : fx.now has NaN value (IE < 9 only)
| Reported by: | poulpillusion@… | Owned by: | poulpillusion@… |
|---|---|---|---|
| Priority: | low | Milestone: | None |
| Component: | effects | Version: | 1.6.4 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Hi,
I think I found a bug in jQuery 1.6.4 (still present in 1.7.2), in IE < 9 (in fact IE7 and IE8).
Here is a jsFiddle, using 1.6.4 : http://jsfiddle.net/ucmGV/6/
IE8 throws the following error : SCRIPT87: Invalid argument. jquery-1.6.4.js, line 8602 character 5
I (hope that I) fixed this error by slightly changing the source. I replaced this function :
_default: function( fx ) {
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
fx.elem.style[ fx.prop ] = (fx.prop === "width" fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit; } else {
fx.elem[ fx.prop ] = fx.now;
}
}
... with this :
_default: function( fx ) {
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null && !isNaN(fx.now) ) {
fx.elem.style[ fx.prop ] = (fx.prop === "width" fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit; } else {
if (!isNaN(fx.now)) {
fx.elem[ fx.prop ] = fx.now;
} else {
fx.elem[ fx.prop ] = 0;
}
}
}
Change History
comment:1 Changed 19 months ago by timmywil
- Owner set to poulpillusion@…
- Priority changed from undecided to low
- Status changed from new to pending
- Component changed from unfiled to effects
comment:2 follow-up: ↓ 3 Changed 19 months ago by d.kurdoghlian@…
Should have high priority, since it is breaking execution completely in IE7+8 - thanks for your fix poulpillusion
comment:3 in reply to: ↑ 2 Changed 18 months ago by poulpillusion@…
- Status changed from pending to new
Replying to d.kurdoghlian@…:
Should have high priority, since it is breaking execution completely in IE7+8 - thanks for your fix poulpillusion
You're welcome. I hope it will find it's way in a next release...
comment:4 Changed 18 months ago by timmywil
- Status changed from new to pending
This can't have high priority until we have a test case showing the behavior of the bug.
comment:5 Changed 18 months ago by poulpillusion@…
- Status changed from pending to new
I reduced the test case here : http://jsfiddle.net/ucmGV/7/
As you can see, the "wrong" button produces no error in modern browsers, but gives a Fatal error in IE < 9.
comment:6 follow-up: ↓ 7 Changed 18 months ago by viktor@…
The problem also happens in jquery 1.7.1
Also, it occurs if you pass as the value of the prop to be animated. E.g.: .animate({'padding-top': })
comment:7 in reply to: ↑ 6 Changed 18 months ago by anonymous
Replying to viktor@…:
The problem also happens in jquery 1.7.1
Also, it occurs if you pass as the value of the prop to be animated. E.g.: .animate({'padding-top': })
the empty quotes were stripped ""
comment:8 follow-up: ↓ 9 Changed 18 months ago by mikesherov
- Status changed from new to closed
- Resolution set to wontfix
the fiddle contains the following code:
.animate({marginLeft: '=0'}
which is incorrect usage. The value should either be absolute (ex: 1) or relative (ex: +=1). Considering this is the wrong way to use this function, and isn't supported, I'm closing this issue as wontfix. If you want the error to disappear, please use one of the supported values for animation, located here: http://api.jquery.com/animate/ under the heading "Animation Properties and Values"
comment:9 in reply to: ↑ 8 Changed 18 months ago by anonymous
Replying to mikesherov:
the fiddle contains the following code:
.animate({marginLeft: '=0'}which is incorrect usage. The value should either be absolute (ex: 1) or relative (ex: +=1). Considering this is the wrong way to use this function, and isn't supported, I'm closing this issue as wontfix. If you want the error to disappear, please use one of the supported values for animation, located here: http://api.jquery.com/animate/ under the heading "Animation Properties and Values"
Well I do know it is an incorrect usage. But I consider that this incorrect usage should throw an error in both IE <9 and all the other browsers. In other browsers it just "dies" silently. Do you consider this difference of behavior as normal or may it be considered as a bug ?
comment:10 Changed 5 months ago by wivlaro
I got this when trying to animate CSS "left" property with a percentage % value. Switching back to a computed pixels value seemed to stop the fx.now from being corrupted on IE8.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Thanks for taking the time to contribute to the jQuery project! Please reduce the test case to the necessary code to demonstrate the issue to help us assess your ticket.