Need Help with transparency and overlays

P

pbd22

hi.

I am using a script to create a opaque background under an active
email form. All the elements on the form are frozen except those on
the opened email window.

Problem is, I cant seem to center my email form :( . It is, as you can
see below, position:absolute. But, when I try "left" or "top", the
entire background moves (the blackened background, that is). How do I
keep the blackened background as is and move the opened email window
to the center of the browser?

I am using IE7.

Thanks!

<script type="text/javascript" src="scripts/round_corners.js"></
script>
<style type="text/css">

#myEmail {
background-color:black;
width:100%;
height:100%;
position:absolute;
filter:alpha(opacity=75);
opacity: 0.75;
-moz-opacity:0.75;
display:none;
}



</style>

<script type="text/javascript">


function ShowForm() {
try {
var body = (document.compatMode &&
document.compatMode != "BackCompat") ? document.documentElement :
document.body;
var UAC = document.getElementById("myEmail");

body.style.overflow = "hidden";

UAC.style.display = "block";

}catch(e){alert(e.message);}
}


function HideForm() {
try {
var body = (document.compatMode &&
document.compatMode != "BackCompat") ? document.documentElement :
document.body;

var UAC = document.getElementById("myEmail");



body.style.overflow = "";

UAC.style.display = "none";
}catch(e){alert(e.message);}
}



function positionit(){
try {
var crossobj = document.getElementById("myEmail");

var iebody = (document.compatMode &&
document.compatMode != "BackCompat") ? document.documentElement :
document.body;



var dsocleft = document.all ? iebody.scrollLeft :
pageXOffset;

var dsoctop = document.all ? iebody.scrollTop :
pageYOffset;



crossobj.style.left = parseInt(dsocleft)+"px";

crossobj.style.top = dsoctop+"px";

}catch(e){alert(e.message);}
}

setInterval("positionit()",10)

</script>
</head>
<body>
<div id="myEmail">
<table cellpadding="1" border="0" cellspacing="0"
style="background-color:White;">
<tbody>
<tr>
<td style="width:100%; height:30px; background-
color:#6699cc; padding:10px;" colspan="2">
<span style="color:white;"><b>Email This Content</b></
span>
</td>
</tr>
<tr>
<td style="padding:15px;">
[SNIP] ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top