There is no need of Javascript. It is also too relative because there is no garantee that you can take user's resolution.
You can solve your problem in this way:
Create your page and where you want to put the menu insert a table. Put the <div></div> into the table and it will be restricted to borders of that table.
Here is an exaple code:
<table width="770" border="1" align="center">
<tr>
<td>
<div id="Layer1" style="position:absolute; width:200px; height:16px; z-index:1">Text in div</div>
</td>
</tr>
</table>
!!! Do not set left: X px; top: Y px because it will depend on how far from border of the browser is, which is your problem. In the other case it will depend on table's borders.
Hope this help
Main Topics
Browse All Topics





by: hexagon47Posted on 2003-02-27 at 09:05:53ID: 8035019
<html> loatingDiv ').style.p ixelLeft =500; loatingDiv ').style.p ixelTop =200; loatingDiv ').style.d isplay ='block'; >
<head>
<script type="text/javascript">
<!--
function checkAndDisplay()
{
if ((screen.width>=1024) && (screen.height>=768))
{
document.getElementById('f
document.getElementById('f
document.getElementById('f
}
else
{
...
}
}
//-->
</SCRIPT>
</head>
<body onload="checkAndDisplay()"
<div id="floatingDiv" style="left:0px; top:0px; position:absolute; width:150px; display:none; background-color:#696969; border:1px solid black">my floating menu</div>
</body>
</html>
obviously you will have to play around with the values bit
did it help?