Wanting to do a lightbox style overlay on page load.

Status
Not open for further replies.


I've never done it but here's a quick attempt:

CSS:
Code:
#overlay{position: absolute; top: 0px; bottom: 0px; left: 0px; right: 0px; width: 100%; height: 100%; background-color: #7b7b7b; opacity:.50;filter: alpha(opacity=50); -moz-opacity: 0.5; text-align: center; display: none;}
#object{position: relative; width: 300px; height: 200px; background-color: #ffffff;}

HTML:
Code:
<div id="overlay"><div align="center">
<div id="object">
text goes here
</div><!--object-->
</div><!--center--></div><!--overlay-->

Javascript:
Code:
function onshow(){
document.getElementById('overlay').style.display='block';
}

like I said I have no idea if that works or not, but I don't see any reasons on why it won't.
test it out let me know what kind of errors you get
 
Status
Not open for further replies.