Hey,
I have a div where I show a little message like ("Loading data..."). I want this always in the middle of my screen.
So I did it with some javascript:
function showdiv() {
var A = document.getElementById(E);
var C = screen.width;
var D = screen.height;
A.style.position ="absolute";
A.style.top = String(Math.round((D-200)/2))+"px";
A.style.left = String(Math.round((C-190)/2))+"px";
A.style.display = "block";
}
css div:
.waitMessage {
display:none;
background-color:#FFF;
border:solid #CCC 4px;
padding:4px;
color:#000;
font-family:Verdana;
font-weight:bold;
position:absolute;
width:380px;
}
my div is 400 height and 380 width. It shows the div in the middle of the screen at the beginning. But when I scroll down and call the action showdiv is shown at the same beginners middle place. Not in the middle of the screen.
thanks
visit my website at
I have a div where I show a little message like ("Loading data..."). I want this always in the middle of my screen.
So I did it with some javascript:
function showdiv() {
var A = document.getElementById(E);
var C = screen.width;
var D = screen.height;
A.style.position ="absolute";
A.style.top = String(Math.round((D-200)/2))+"px";
A.style.left = String(Math.round((C-190)/2))+"px";
A.style.display = "block";
}
css div:
.waitMessage {
display:none;
background-color:#FFF;
border:solid #CCC 4px;
padding:4px;
color:#000;
font-family:Verdana;
font-weight:bold;
position:absolute;
width:380px;
}
my div is 400 height and 380 width. It shows the div in the middle of the screen at the beginning. But when I scroll down and call the action showdiv is shown at the same beginners middle place. Not in the middle of the screen.
thanks
visit my website at