YUILibrary - Open source JavaScript and CSS for building richly interactive software.
Fork YUI on GitHub

YUI 2.x

Ticket #2528440 (accepted defect)

Reporter


Kaven Yan
Opened: 09/7/09
Last modified: 09/15/09
Status: accepted
Type: defect

Owner


Matt Sweeney
Target Release: 2.NEXT
Priority: P3 (normal)
Summary: (no layout elements).setStyle('opacity','0.3') has a bug in IE8 standard mode
Description:

visit http://dancewithnet.com/lab/2009/css-opacity/#demo9 in IE8 standard mode
1. demo9's html: <span id="demo9">demo9</span>
2. YAHOO.util.Dom.get('demo9').setStyle('opacity','0.3');
3. demo9 isn't a layout element, and YUI set it {zoom:1;}, but zoom can't trigger layout in IE8 standard mode
so it's failed
the following is a successful method:
var setOpacity = function(el,i){
if(window.getComputedStyle){// for non-IE
el.style.opacity = i;
}else if(document.documentElement.currentStyle){ // for IE
if(!el.currentStyle.hasLayout){
el.style.zoom = 1;
}
if(!el.currentStyle.hasLayout){ //for IE8
el.style.display = 'inline-block';
}
el.style.filter = 'alpha(opacity='+ i * 100 +')';
}
}

pls visit demo12: http://dancewithnet.com/lab/2009/css-opacity/#demo12

Type: defect Observed in Version: 2.7.0
Component: Dom Severity: S3 (normal)
Assigned To: Matt Sweeney Target Release: 2.NEXT
Location: Library Code Priority: P3 (normal)
Tags: Dom,setStyle Relates To:
Browsers: IE 8.x
URL: http://dancewithnet.com/lab/2009/css-opacity/#demo9
Test Information:

Change History

Matt Sweeney

YUI Developer

Posted: 09/8/09
  • location changed to Library Code
  • milestone changed to 2.NEXT
  • priority changed to P3 (normal)
  • status changed from new to accepted

Kaven Yan

Posted: 09/15/09

It still existed in YUI 2.8.0.