• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Screen resolution

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi again,
I am unable to get the right screen resolution. Iu always get on the 800x600 resolution. Here is part of my code:
<SCRIPT Language="JavaScript">
<!--
if((screen.width >= 800) && (screen.height >= 600))
{
location.href = "800x600.html"
}
else
{
location.href = "1024x768.html"
}
//-->
</SCRIPT>
No mather what the resolution is, i always get the 800x600 page. I tried it on several computer--> always the same result
Can somebody help me???
Thanks
Jeff
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
your condition will be true if the screen resolution is over 800x600, therefore, you'll get always the 800x600 page for high resolution
maybe if you set this condition
if((screen.width <= 800) && (screen.height <= 600))
it would work
 
I am going down to the lab. Do NOT let anyone in. Not even this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic