Search and Top Navigation
#4216 closed bug (duplicate)
Opened February 23, 2009 04:02PM UTC
Closed September 20, 2009 09:11PM UTC
Invalid Property on IE7 within jQuery Color Animations
Reported by: | buro9 | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.8 |
Component: | ui.effects.core | Version: | 1.6rc6 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Our code looks like this:
.effect("highlight", {}, 1500)
Where the jQuery object that it performs this on is one or more of:
TD, INPUT, SELECT
Basically we're highlighting a whole row include the form elements.
In IE7 we've witnessed that if you call this, leave the page, come back and call it again then we receive a "Invalid Property" error.
The code is to be found in the rc6 unminified version around line 7837, and directly follows this code:
/* * jQuery Color Animations * Copyright 2007 John Resig * Released under the MIT and GPL licenses. */ // We override the animation for all of these color styles $.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i, attr) { $.fx.step[attr] = function(fx) { if (fx.state == 0) { fx.start = getColor(fx.elem, attr); fx.end = getRGB(fx.end); }
I've exploded the bit of code that is affected so that it looks like this:
var r = Math.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0], 10), 255), 0); var g = Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1], 10), 255), 0); var b = Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2], 10), 255), 0); fx.elem.style[attr] = "rgb(" + [r,g,b].join(",") + ")";
What I see using Visual Studio as the debugger is that ALL of r, g and b are NaN, and so setting the backgroundColor fails with the "Invalid Property" error.
Same problems here.
http://www.hyper-olympic.de/jquery_example/
After a few updates the IE7 and IE6 are trying to set the backgroundColor to NaN and stopping the script with "Invalid Property"