positioning div - crossover - screen width relative

O

old.Marcus

Guest
Hi there! Really need help positioning my div relativ to the width of the user screen.

the code i tried to build is following.
Anyone gets any idea - why this doesnt work?
Anyone being able to help me (gotta be crossover for ie, ns, ns6.1)
Thank u to all trying to help me - please mail: sgboy@web.de



<script type="text/javascript" language="javascript">
<!--
function objpos(objid,x,y)
{
if(document.documentElement)
{
document.getElementById(objid).style.top=y+"px";
document.getElementById(objid).style.left=x+"px";
}
if (document,layers)
{
document.layers[objid].top=y;
document.layers[objid].left=x;
}
if (document.all)
{
document.all[objid].style.pixelTop=y;
document.all[objid].style.pixelLeft=x;
}

function init()
{
if(navigator.appName=="Netscape")
{
var w=innerWidth;
var h=innerHeight;
} else
{
var w=document.body.offsetWidth;
var h=document.body.offsetHeight;
}
var mw=parseInt (w/4);
var mh=parseInt (h/5);
objpos(pergament, mw, mh);
}
}
//-->
</script>
<meta content="MSHTML 5.00.2614.3500" name="generator">
</head>
<body onload="objpos(pergament,150,150)">
<div id="pergament" style=
"position:absolute; left:10px; top:10px; z-index:1; border-width:1px; border-style:none;">
</div>
 

Users who are viewing this thread

Top Bottom