Hi, I have a pop up on my index page which dims the background out and displays an image on middle of page. This seems to work ok, but i don't want it to appear again when they refresh or go back to home page. However, if they leave the website or close there browser, the next time they come on, it will appear again. So basically show each session, once. Here is the code i have used, not my code, im just a newbie.
P.S
Just a couple of other things, this works fine in FF but IE, the index page shows, underneath the overlay?? any idea's. One last thing, i have the jpg centered, but only horizontal. Any ideas how to align it vertically.
Would be great if anyone could help.
Thanks.
Code:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
div.overlay {
display:none;
position:absolute;
background-image:url(images/overlay.png);
z-index:1000;
left:0px;
top:0px;
width:100%;
height:100%;
position:fixed;
}
/* html div.overlay {
background-color:#000;
back\ground-color:transparent;
/*background-image:url(images/roadshow_index_pic.jpg);
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="overlay.png", sizingMethod="scale");*/
}
div.message {
display:none;
position:fixed;
background-color:#FFF;
background-repeat:no-repeat;
z-index:4000;
border:#000 1px solid;
padding:11px 10px 10px 10px;
left:50%;
top:400px;
font:12px Verdana, Arial, Helvetica, sans-serif;
}
</style>
<script type="text/javascript" language="javascript">
function showOverlay() {
document.getElementById("overlay").style.display = "block";
}
function hideOverlay() {
document.getElementById("overlay").style.display = "none";
}
function clickOverlay() {
hideMessage();
}
function hideMessage() {
document.getElementById("message").style.display = "none";
hideOverlay();
}
function showStartMessage() {
var message = document.getElementById("message");
message.style.display = "block";
message.style.marginLeft = -(message.offsetWidth / 2) + "px";
showOverlay();
window.setTimeout(hideMessage, 30000);
}
</script>
</head>
<body onload="showStartMessage()">
<div class="overlay" align="center" id="overlay" onClick="clickOverlay()"><img src="images/roadshow_index_pic.jpg" border="5"/> </div>
<div class="message" id="message"><a href="#" onclick="hideMessage()">Close</a></div>
</body>
Just a couple of other things, this works fine in FF but IE, the index page shows, underneath the overlay?? any idea's. One last thing, i have the jpg centered, but only horizontal. Any ideas how to align it vertically.
Would be great if anyone could help.
Thanks.