Skip to main content

Bug Tracker

Side navigation

#10582 closed bug (wontfix)

Opened October 26, 2011 12:45PM UTC

Closed November 28, 2011 11:19PM UTC

Last modified October 14, 2013 09:09AM UTC

Invalid argument on line 8602 in jQuery 1.6.4 : fx.now has NaN value (IE < 9 only)

Reported by: poulpillusion@free.fr Owned by: poulpillusion@free.fr
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;

}

}

}

Attachments (0)
Change History (11)

Changed November 02, 2011 12:54AM UTC by timmywil comment:1

component: unfiledeffects
owner: → poulpillusion@free.fr
priority: undecidedlow
status: newpending

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.

Changed November 11, 2011 11:56AM UTC by d.kurdoghlian@pushingpixels.at comment:2

Should have high priority, since it is breaking execution completely in IE7+8 - thanks for your fix poulpillusion

Changed November 15, 2011 11:16AM UTC by poulpillusion@free.fr comment:3

status: pendingnew

Replying to [comment:2 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...

Changed November 15, 2011 02:57PM UTC by timmywil comment:4

status: newpending

This can't have high priority until we have a test case showing the behavior of the bug.

Changed November 23, 2011 02:09PM UTC by poulpillusion@free.fr comment:5

status: pendingnew

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.

Changed November 28, 2011 10:25AM UTC by viktor@imperia.net comment:6

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': ''})

Changed November 28, 2011 10:26AM UTC by anonymous comment:7

Replying to [comment:6 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 "''"

Changed November 28, 2011 11:19PM UTC by mikesherov comment:8

_comment0: 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"1322522393928216
resolution: → wontfix
status: newclosed

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"

Changed November 29, 2011 07:37AM UTC by anonymous comment:9

Replying to [comment:8 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 ?

Changed December 17, 2012 01:43PM UTC by wivlaro comment:10

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.

Changed October 14, 2013 09:09AM UTC by Dmitri comment:11

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