PDA

View Full Version : css opacity (NS and IE)


Terry
07-16-2003, 09:00 AM
Hi,

I'm trying to get a drop-down menu to be semi-transparent for mozilla and ie. Earlier I had it working but now it doesn't work for netscape.

http://www.xdevdesign.com/clients/pept/

The css is written out with js so I can still validate, but that shouldn't make a difference.. it was working before. Code for the sub-menu:

<script type="text/javascript">

//<![CDATA[
var w_style = '<style type="text/css">div.menu \{ '
+ 'position: absolute\;'
+ 'left: 27%\;'
+ 'top: 30px\;'
+ 'background: #f5f5f5\;'
+ 'color: #000\;'
+ 'visibility: hidden\;'
+ 'z-index: 10\;'
+ 'text-align: left\;'
+ 'padding: 0px\;'
+ 'border: 1px solid #999\;'
+ 'filter:alpha(opacity=90)\;'
+ 'filter:progid:DXImageTransform.Microsoft.Alpha(opacity=90)\;'
+ '-moz-opacity:0.9\;\}<\/style>';
document.write(w_style);

//]]>
</script>


Any ideas? I know it must be simple but I can even see straight I been working on this page so long!

Thanks,
- Terry

smilies disabled by jkd, your friendly supermoderator :)

theabyss
07-16-2003, 05:23 PM
+ 'filter:progid:DXImageTransform.Microsoft.Alpha(opacity=90)\;'


You have to edit your post and check the option "Disable Smilies in This Post". That will remove the accidental :p and :D in your code.

Terry
07-16-2003, 06:45 PM
Hey, thanks for the heads up the smilies and for fixing it jkd!

Any ideas on this opacity thing?

-Terry

Roy Sinclair
07-16-2003, 09:32 PM
Try it without the IE specific settings included. There may be something in those rules that's throwing the parsing of CSS Rules off.

Terry
07-17-2003, 06:26 AM
Thanks for the suggestion.. it still doesn't work with in NS with just the moz rules. I'm not sure what it is and to tell you the truth It's not important anyway.. my client isn't paying me for it so I won't waste anymore time trying to figure it out.

Thanks,
-Terry

ConfusedOfLife
08-15-2003, 09:08 AM
Does it work in NS if you write it simply without JS? I mean if you only write:


filter:alpha(opacity=90)


Because I can't reduce the opacity in NS even when I write it normally in the <style> tag!

MotherNatrsSon
08-15-2003, 05:53 PM
Originally posted by ConfusedOfLife
Does it work in NS if you write it simply without JS? I mean if you only write:


filter:alpha(opacity=90)


Because I can't reduce the opacity in NS even when I write it normally in the <style> tag!

See this thread (http://www.codingforums.com/showthread.php?s=&threadid=13825)

MNS

ConfusedOfLife
08-15-2003, 07:19 PM
Thank you MotherNatrsSon, I read that thread, it's cooooool!