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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Positioning layers for both 800*600 and 1024*768 resolution 5

Status
Not open for further replies.

flasher

Technical User
Mar 4, 2002
245
US
It's probably best to design for both 800*600 and 1024*768 resolution. Say you have layers on your page. I can center tables to looks good in both resolutions but layers will be thrown off in a different res. and also if I have a popup menu or a pop up window that is absolutely positioned in the code using x and y params, that will also be thrown off. So how do you design these page elements to look good in both 800*600 and 1024*768? Thank you very much for any advice.
 
Heck of a job GUJUm0deL! :)


É

endamcg-logo1b.gif

 
thankyou cian...:) I have not failed; I merely found 100,000 different ways of not succeding...
 
I'm sure it was posted but:


<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
<!-- //This is for centering the layer
if (document.all)
{
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
else
{
winW = window.innerWidth;
winH = window.innerHeight;
}
document.writeln('<STYLE TYPE=&quot;text/css&quot;>');
document.writeln('<!--');
document.writeln('#layer1 {Position: absolute; VISIBILITY: hidden; left:'+(winW/2-250/2)+'; top:'+(winH/2-175/2)+';}');
document.writeln('.message {Position: absolute; left:'+(winW/2-40)+'; top: '+10+';}');
document.writeln('-->');
document.writeln('</STYLE>');
//-->
</SCRIPT>

winW/2-250/2 --The 250 is the width of the div (change as needed)
winH/2-175/2 --The 175 is the height of the div (change as needed)

Tested in:

IE 5.5
IE 6
Mozilla 1.0 / Netscape 6
Netscape Navigator 4.7
Opera 5.12
Opera 6
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top