Forum Moderators: not2easy
HTML
<div id="popup">my pop up text</div>
#popup{
z-index:13;
background-color:#333333;
position:fixed;
height:100%;
width:100%;
top:0px;
left:0px;
opacity: 0.40;
filter: alpha(opacity=40);
}
the div is suppose to popup on top of the page content when a button is clicked.
but problem is position:fixed does not work in IE6.
Is there a way i can get the same result in IE6 some how?
Any fix for position:fixed in IE6?
thank a lot again
Vik
position: fixed and many other things for versions of IE 6 and older.
I had the same problem and used the following fix. The CSS is straight off my page, so ignore what you don't need.
<style type="text/css"> /* The everyone else CSS */
#shadow {top:0px;width:200px;padding:5%;filter:shadow(color:gray, strength:10, direction:135); position:fixed; margin-left: 70%;}
</style>
<!--[if lte IE 6]>
<style type="text/css">
/*<![CDATA[*/
* html #shadow{ /*IE6 only rule, applied on top of the default above*/
position: absolute;
top: expression(document.compatMode=="CSS1Compat"? document.documentElement.scrollTop-40+"px" : body.scrollTop-40+"px");
}
/*]]>*/
</style>
<![endif]-->
It worked well for me.
Marshall
Hey, Marshall. That's a neat solution too.
Does it jump at all? And, by the way, what's that "-40" for?
It jumps a little. The minus forty (-40) was to offset the <div> as it was being pushed down too far and I was trying to flush it with the top of the window. I'm using it on a fixed menu which is rather long and I did not want the bottom cut off. It's a dimension that can be played with. Frankly, I'd like to put an announcement up that says "UPGRADE YOUR BROWSER", but that's tacky, IMHO. Generally though, I avoid things that aren't "browser friendly" without a fix - this is my one and only exception. (I hate doing all the "If" statements)
I do have another "fix" which is browser friendly, but the menu (in my case) would scroll up/down with the page then reappear in an absolute position. It's position is based on x/y of the window, similar to the patch above, but without any bounce.
Marshall