Lunarpages Web Hosting Forum

Author Topic: Javascript to change part of code based on screen resolution  (Read 1071 times)

Offline Runilo

  • Spaceship Navigator
  • *****
  • Posts: 88
Javascript to change part of code based on screen resolution
« on: November 09, 2004, 04:56:18 AM »
Hey there

I was wondering if anyone knows a javascript that can change som div sizes based on the screen resolution.

The site i'm working on is this one:

http://www.thehumorpage.com/test2/test.php

I want the tower add on the left to fit right next to the menu at most standard screen resolutions, just as it does with with 1024x768

So, does anyone know a script that can change the pixels in a div based on the screen resolution??

Thanks in advance

Offline TranzNDance

  • Princess of Naboo
  • Berserker Poster
  • *****
  • Posts: 11567
    • Thu Tu's Blog
Javascript to change part of code based on screen resolution
« Reply #1 on: November 09, 2004, 08:06:41 AM »
That's assuming that the user wants to have the window open full size. Not everyone wants that. I have a wide screen on my laptop. When your site opened full-sized, there was a lot of wasted space on the sides. People get big screens so that they have multiple windows open simultaneously. Having one window decide that it should monopolize the entire screen is very user-unfriendly.
:whip: :love: :whip: :love: :whip: :love:

Offline Runilo

  • Spaceship Navigator
  • *****
  • Posts: 88
Javascript to change part of code based on screen resolution
« Reply #2 on: November 09, 2004, 08:54:20 AM »
Yes that script that forced the window to full mode is not a permanent solution. I didn't give thought to the widescreens, but thank you for bringing it up