Skip to main content

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.

Attachments (1)
  • screen_002.png (32.0 KB) - added by chip75 February 24, 2009 10:34AM UTC.
Change History (4)

Changed February 24, 2009 10:35AM UTC by chip75 comment:1

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"

Changed February 27, 2009 03:19PM UTC by jzaefferer comment:2

component: ui.coreeffects.core
milestone: TBD1.7

Changed March 08, 2009 02:43PM UTC by rdworth comment:3

milestone: 1.71.8

Changed September 20, 2009 09:11PM UTC by scottgonzalez comment:4

resolution: → duplicate
status: newclosed

Duplicate of #4251.