fileserverdirect
03-11-2008, 01:09 AM
Hi guys,
I was recently helping someone out on the forums, when I modified one of my ideas to work for my website. The only problem is that I need the 1x1 semi-transparent png to be ontop of the page's content, but below the actual popup div. Also, is there any way for the div to be auto centered in the document?
<html>
<head>
<style>
div#container {
background: #CCCCCC;
border: 1px solid black;
position:absolute;
left:-9999px;
top:-9999px;
width: 200px;
z-index: 2;
}
#body
{
z-index: 0;
}
#top
{
z-index: 1;
}
</style>
<script>
function init(x)
{
if(x=="show"){
document.getElementById("container").style.left="200px"
document.getElementById("container").style.top="200px"
document.getElementById("top").style.background="url('t.png') repeat"
}
if(x=="hide"){
document.getElementById("container").style.left="-9999px"
document.getElementById("container").style.top="-9999px"
document.getElementById("top").style.background="none"
}
}
</script>
<body id="top">
<div id="body">
<div id="container">
<p>various text goes here</p>
<input type="button" onClick="init('hide');" value="Hide Text">
</div>
<input type="button" onClick="init('show');" value="Show Text">
Some random Text
</div>
</body>
</html>
THANKS.
The Image could'nt be uploaded...
I was recently helping someone out on the forums, when I modified one of my ideas to work for my website. The only problem is that I need the 1x1 semi-transparent png to be ontop of the page's content, but below the actual popup div. Also, is there any way for the div to be auto centered in the document?
<html>
<head>
<style>
div#container {
background: #CCCCCC;
border: 1px solid black;
position:absolute;
left:-9999px;
top:-9999px;
width: 200px;
z-index: 2;
}
#body
{
z-index: 0;
}
#top
{
z-index: 1;
}
</style>
<script>
function init(x)
{
if(x=="show"){
document.getElementById("container").style.left="200px"
document.getElementById("container").style.top="200px"
document.getElementById("top").style.background="url('t.png') repeat"
}
if(x=="hide"){
document.getElementById("container").style.left="-9999px"
document.getElementById("container").style.top="-9999px"
document.getElementById("top").style.background="none"
}
}
</script>
<body id="top">
<div id="body">
<div id="container">
<p>various text goes here</p>
<input type="button" onClick="init('hide');" value="Hide Text">
</div>
<input type="button" onClick="init('show');" value="Show Text">
Some random Text
</div>
</body>
</html>
THANKS.
The Image could'nt be uploaded...