Ciao,
con un po' di lavoro per ora sono riuscito a tirare fuori questo:
codice:
<html>
<head>
<title>Prova livello ad entrata</title>
<style type="text/css">
#lev {
position : absolute;
text-align : center;
top : 0px;
left : -200px;
border : 1px solid #000000;
background-color : #ff0000;
width : 150px;
height : 150px;
zorder : 1;
}
</style>
<script language="Javascript">
<!--
document.write('<div id=\"lev\">prova<\/div>');
function slideWindow() {
var x = -150;
var y = (screen.availHeight/2) - 152;
var z = 6; //velocità
var stop = (screen.width - 152) / 2;
if (document.layers) {
document.layers["lev"].moveTo(200,0);
function moveit() {
x = x + z;
document.layers["lev"].moveTo(200,x);
}
}
else {
var layer;
if (document.all) {
layer = document.all["lev"];
}
else if (document.getElementById) {
layer = document.getElementById("lev");
}
layer.style.left = x + 'px';
layer.style.top = y;
function moveit(){
x=x+z;
layer.style.left = x + 'px';
if (x>=stop){
clearInterval(newInt);
document.getElementById("lev").innerHTML = "Eccomi arrivato al centro dello schermo!";
}
}
}
var newInt;
newInt = window.setInterval(moveit,1);
}
//-->
</script>
</head>
<body>
<center>
Prova la finestra
</center>
</body>
</html>
Magari è ancora un po' rozzo ma l'ho provato su ie6, mozilla 1.4 netscape 7 e opera 7+ e funziona bene.