corretto, giā testato, funziona benissimo
Codice PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Z-Index</title>
<style type="text/css">
div#contenitore { width: 40em; height: 500px; margin: 0 auto; background: #000000; position: relative; z-index: 0;}
div#uno { position: absolute; z-index: 3; height: 100px; width: 250px; background: #009966; top: 50px; padding: 1em;}
div#uno:hover { z-index: 10;}
div#due { position: absolute; z-index: 2; height: 100px; width: 250px; background: #CC9900; top: 70px; left: 50px; padding: 1em;}
div#due:hover { z-index: 10;}
div#tre { position: absolute; z-index: 1; height: 100px; width: 250px; background: #CC3300; top: 90px; left: 100px; padding: 1em;}
div#tre:hover { z-index: 10;}
</style>
<script type="text/javascript">
function supporta(){
if(document.styleSheets) msg = "l'oggetto styleSheets\nč supportato"
else msg = "l'oggetto styleSheets\nNON\nč supportato"
alert(msg)
}
</script>
<script type="text/javascript">
/*Prova con la creazione di oggetti*/
function cambia(id,zI){
if(id)
{
document.getElementById(id).style.zIndex=zI;
}
}
function ripristina(id)
{
document.getElementById(id).style.zIndex="auto";
}
</script>
</head>
<body>
<div id="contenitore">
<div id="uno">
Ciao sono il primo div</p>
</div>
<div id="due">
Ciao sono il secondo div</p>
</div>
<div id="tre">
Ciao sono il terzo div</p>
</div>
<div id="link" style="position: absolute; top: 300px; height: auto; width: 200px; background: #fff;">
[url="#"]Mostra il primo[/url]</p>
[url="#"]Mostra il secondo[/url]</p>
[url="#"]Mostra il terzo[/url]</p>
[url="#"]verifica[/url]
</div>
</div>
</body>
</html>
Questo non avrebbe mai funzionato "due.style.zIndex="20";" !
se vuoi sollevare il div "due" dei scrivere "document.getElementById("due").style.zIndex=2 0;"
Ciao!