Opened 11 years ago

Closed 10 years ago

#4216 closed bug (duplicate)

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 11 years ago.

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by chip75

Attachment: screen_002.png added

comment:1 Changed 11 years ago by chip75

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"

comment:2 Changed 11 years ago by Jörn Zaefferer

Component: ui.coreeffects.core
Milestone: TBD1.7

comment:3 Changed 11 years ago by rdworth

Milestone: 1.71.8

comment:4 Changed 10 years ago by Scott González

Resolution: duplicate
Status: newclosed

Duplicate of #4251.

Note: See TracTickets for help on using tickets.