Click to See Complete Forum and Search --> : howto position in upper right corner


mozkill
03-20-2003, 11:42 AM
I have been trying to get this layer, which contains a alert message that is 400x100px in size, in the upper right hand corner of the browsers "inner width" by using the window.innerWidth control.

Does anyone know how to do this? All examples of this sort of thing on the internet do not deal with layers and so i cant figure this out.

<!-- BEGIN FLOATING LAYER CODE //-->
<div id="theLayer" style="position:absolute;width:400px;left:100;top:50;visibility:visible">

I can share my full code if you email me directly at jwilliams AT thinkstream DOT com

gil davis
03-20-2003, 12:37 PM
Here's an example:<head>
<script>
function moveIt() {
document.getElementById("theLayer").style.top = 0;
document.getElementById("theLayer").style.left = document.getElementsByTagName("body")[0].clientWidth - 400;
}
</script>
</head>
<body onload="moveIt()">
<div id="theLayer" style="position:absolute; width:400px; left:100; top:50; visibility:visible; border: 1pt solid red">
This is the div
</div>
</body>I added a border so it was easier to see.