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

check resolution?

Status
Not open for further replies.

cyprus106

Programmer
Apr 30, 2001
654
I've heard that there is a function around somewhere that checks resolution and fits your webpage to size??

I'm completely new at javascript but I was hoping there was some way to do just that: Check user resolution and fit accordingly? I don't exactly know how, if at all, feasable this is...

Thanks, Cyprus
 
cyprus106, you can use JS to check the users screen resolution and load the correct page, for instance load one instance of the HTML page for 1024*768 and another instance for the HTML for 800*600 resolution...
For that this is the code:
[color]
<script>
var wd = screen.width
var hi = screen.height

if ((wd >= 1024) || (hi >= 768)) {
document.location.href = '1024Resolution.html';
}
else {
document.location.href = '800Resolution.html';
}
</script>
[/color]
Put this code in the <head></head> section, and that's it...
Hope this helps... Forget the Nobel Peace prize, I just want to take over the world!! [hammer]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top