Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9904 (closed defect: fixed)

Opened 9 months ago

Last modified 9 months ago

setOpacity fails for new Element

Reported by: webbles Assigned to: sam
Priority: high Milestone: 2.x
Component: Prototype Version: edge
Severity: normal Keywords:
Cc:

Description

If you call setOpacity (either through setStyle or directly) with a brand new element through the "new Element" construct, IE will through an error because currentStyle is not defined. If you attach the element to the DOM, then the error goes away.

Change History

10/18/07 23:20:03 changed by dcpedit

I'm getting this problem too. For the fix, I simply did this in Element.Methods.setOpacity:

Change from

if (!element.currentStyle.hasLayout) element.style.zoom = 1;

to

if (element.currentStyle && !element.currentStyle.hasLayout) element.style.zoom = 1;

10/22/07 13:15:07 changed by tobie

  • status changed from new to closed.
  • resolution set to fixed.

(In [7991]) prototype: In IE, allow opacity to be set on elements not yet attached to the document. Closes #9904.