{"id":2156,"date":"2010-03-23T19:09:21","date_gmt":"2010-03-23T14:09:21","guid":{"rendered":"http:\/\/www.chiragmehta.info\/chirag\/?p=2156"},"modified":"2010-03-23T19:18:05","modified_gmt":"2010-03-23T14:18:05","slug":"yui-library-the-transparent-mask-turns-black-in-ie-8","status":"publish","type":"post","link":"https:\/\/www.chiragmehta.info\/chirag\/2010\/03\/23\/yui-library-the-transparent-mask-turns-black-in-ie-8\/","title":{"rendered":"YUI Library &#8211; The transparent mask turns black in IE 8"},"content":{"rendered":"<p><strong>Problem Statement<\/strong><br \/>\nI use the YUI dialog in my project and turn on the &#8220;modal&#8221;, the initializing code looks like:<\/p>\n<blockquote><p><code>document.mainDialog = new YAHOO.widget.Dialog(&quot;mainPanel&quot;,<br \/>\n                              {   modal: false,<br \/>\n                                  width: &quot;89em&quot;,<br \/>\n                                  height: &quot;30em&quot;,<br \/>\n                                  fixedcenter: true,<br \/>\n                                  visible: false,<br \/>\n                                  constraintoviewport: true<br \/>\n                              });<\/code><\/p><\/blockquote>\n<p>The modal works fine in IE 7.0 and Fireforx 3.0, it generates a transparent mask to prevent activating any elements in the document before closing the modal. But in IE 8.0, the transparent mask turns to &#8220;black&#8221;, rather than &#8220;transparent&#8221;. <\/p>\n<p><strong>Solution<\/strong><br \/>\nThe cause is that IE8 does not support the CSS3 &#8216;opacity&#8217; selector. But YUI uses this to style the mask as follows:<\/p>\n<blockquote><p>.yui-skin-sam .mask {<br \/>\nbackground-color:#000000;<br \/>\nopacity:0.25;<br \/>\n}\n<\/p><\/blockquote>\n<p>To solve this problem &#8211; I have an IE specific stylesheet in which I override the above style as follows:<\/p>\n<blockquote><p>.yui-skin-sam .mask{<br \/>\nfilter: alpha(opacity=30);<br \/>\n}\n<\/p><\/blockquote>\n<p>Read more about the bug @ <a href=\"http:\/\/yuilibrary.com\/projects\/yui2\/ticket\/2528621\" target=\"_blank\" rel=\"noopener\">YUI Library<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Problem Statement I use the YUI dialog in my project and turn on the &#8220;modal&#8221;, the initializing code looks like: document.mainDialog = new YAHOO.widget.Dialog(&quot;mainPanel&quot;, { modal: false, width: &quot;89em&quot;, height: &quot;30em&quot;, fixedcenter: true, visible: false, constraintoviewport: true }); The modal works fine in IE 7.0 and Fireforx 3.0, it generates a transparent mask to prevent [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[27],"class_list":["post-2156","post","type-post","status-publish","format-standard","hentry","tag-javascript","post-preview"],"_links":{"self":[{"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/posts\/2156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/comments?post=2156"}],"version-history":[{"count":4,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/posts\/2156\/revisions"}],"predecessor-version":[{"id":2160,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/posts\/2156\/revisions\/2160"}],"wp:attachment":[{"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/media?parent=2156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/categories?post=2156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/tags?post=2156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}