Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to I postion a layer relative to user's screen resolution?

Status
Not open for further replies.

corbitt

MIS
Feb 22, 2002
73
0
0
US
Please help!!!

I positioned a layer using 1024 x 768 resolution, and it looked great. However, when I changed my resolution to 800 x 600, the layer's placement wasn't where it should be.

Here's some of my code:

<div id=&quot;Layer1&quot; style=&quot;position:absolute; left:86px; top:239px; width:176px; height:400px; z-index:1&quot;>

I found a javascript used during onload to detect the user's screen resolution, but I don't know how to set left & top with it:

<script language=&quot;Javascript1.1&quot;>
<!--
//this code was designed by Brian Zimmer
function detect(){
if(screen.width<1024||screen.height<768){
### SET LEFT & TOP FOR 800 x 600 ###
}
else{
### SET LEFT & TOP FOR 1024 x 768 ###
}

}
//-->
</script>

Am I on the right track?

Thank you,

Jeremy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top