<html >
<head>
<title>Untitled Page</title>
<script type="text/javascript">
function set_Position() {
var obj = document.getElementById('DIV');
var obj_width = parseInt(obj.style.width);
var obj_height = parseInt(obj.style.height);
var obj_top = parseInt(obj.style.top);
var obj_left = parseInt(obj.style.left);
var obj_right = obj_left + obj_width;
var obj_bottom = obj_top + obj_height;
var winW = 630, winH = 460;
if (document.body && document.body.offsetWidth) {
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
if (document.compatMode == 'CSS1Compat' && document.documentElement && document.documentElement.offsetWidth) {
winW = document.documentElement.offsetWidth;
winH = document.documentElement.offsetHeight;
}
if (window.innerWidth && window.innerHeight) {
winW = window.innerWidth;
winH = window.innerHeight;
}
var page_height = winH;
var page_width = winW;
obj.style.top = (page_height - obj_height) + 'px';
obj.style.left = ((page_width / 2) - (obj_width / 2)) + 'px';
} //end function set_Position()
</script>
</head>
<body style="background-color: Black"; onload="set_Position();">
<div id="DIV" style="border: 1pt solid red; width:400px; height: 200px; background-color:White; position: absolute; top:0px; left: 0px;" >
</div>
</body>
</html>
Bookmarks