Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: SV: Desktop resolution


Message #1 by "Robert Nyman" <robert.nyman@c...> on Mon, 16 Sep 2002 10:59:32 +0200
Hi,

The following helps to find out the desktop width & height using JavaScript.

1 Internet Explorer


document.body.clientWidth - gives the width of the screen. eg (640, 800, 1024)

document.body.clientHeight - gives the height of the screen. eg (480, 600, 768) 

2 Netscape Navigator


window.innerWidth - gives the width of the screen. eg (640, 800, 1024)

window.innerHeight - gives the height of the screen. eg (480, 600, 768) 

Vimal

  ----- Original Message ----- 
  From: Robert Nyman 
  To: javascript 
  Sent: Monday, September 16, 2002 2:29 PM
  Subject: [javascript] SV: Desktop resolution


  Check for screen.width and screen.height...

  /Robert


  -----Ursprungligt meddelande-----
  Från: Nabi [mailto:nabi@c...] 
  Skickat: den 16 september 2002 07:39
  Till: javascript
  Ämne: [javascript] Desktop resolution


  Hi all,
  Can somebody say how with javascript to find out desktop width and
  height. For example is user using 800x600 or 1024x768, so that I can use
  different CSS file for different resolutions.

  Thanks

  Nabi




  ---

  Improve your web design skills with these new books from Glasshaus.

  Usable Web Menus
  http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
  r-20
  Constructing Accessible Web Sites
  http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
  r-20
  Practical JavaScript for the Usable Web
  http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
  r-20



  ---

  Improve your web design skills with these new books from Glasshaus.

  Usable Web Menus
  http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
  r-20
  Constructing Accessible Web Sites
  http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
  r-20
  Practical JavaScript for the Usable Web
  http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
  r-20



  Return to Index