#10582 closed bug (wontfix)
Invalid argument on line 8602 in jQuery 1.6.4 : fx.now has NaN value (IE < 9 only)
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | effects | Version: | 1.6.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
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 (11)
comment:1 Changed 11 years ago by
Component: | unfiled → effects |
---|---|
Owner: | set to [email protected]… |
Priority: | undecided → low |
Status: | new → pending |
comment:2 follow-up: 3 Changed 11 years ago by
Should have high priority, since it is breaking execution completely in IE7+8 - thanks for your fix poulpillusion
comment:3 Changed 11 years ago by
Status: | pending → new |
---|
Replying to [email protected]…:
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 11 years ago by
Status: | new → pending |
---|
This can't have high priority until we have a test case showing the behavior of the bug.
comment:5 Changed 11 years ago by
Status: | pending → 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 11 years ago by
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 Changed 11 years ago by
Replying to [email protected]…:
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 11 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
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 Changed 11 years ago by
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 10 years ago by
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.
comment:11 Changed 9 years ago by
I have same issue with jquery 1.7.2 and jquery ui 1.8 when I set value for jquery ui slider $("#slider").slider("value", "0"); in IE8
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.