• 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

Width and Height

 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
The script at http://www.a1ien51.8k.com/scripts/popupwingenV2.htm
var ScreenWidth=window.screen.width;
var ScreenHeight=window.screen.height;
This gives the monitor screen and height,for example 1024,768.
Is there is any way to calculate browser-display-area width and height ?,i mean the area where you see the web pages(below the address bar and
above the status bar)??
Thank you
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try this:
var ScreenWidth=window.screen.availWidth
var ScreenHeight=window.screen.availHeight
 
Balaji Loganathan
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by christoph weingarten:
try this:
var ScreenWidth=window.screen.availWidth
var ScreenHeight=window.screen.availHeight


No its not giving the actual size.
the new values are 1024,740
740 -> is taller than the workarea of the browser.
 
christoph weingarten
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well, maybe you used:
window.innerHeight
window.innerWidth
but thats just netscape/mozilla. in IE it's a little bit more tricky. there you use:
document.body.offsetHeight
document.body.offsetWidth
but you have to call these both methods after the availably of the body-element. the best thing is to use onLoad for that.
hope, it helps
christoph
[ October 17, 2002: Message edited by: christoph weingarten ]
 
Balaji Loganathan
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by christoph weingarten:
hope, it helps
christoph


Hi Christoph,
Yes!.. It worked for me,thanks a lot.Please tell me how did you come to know this? (Of course by experience )
Regards
Balaji
 
christoph weingarten
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Balaji,
there is a great html-guide called selfhtml http://selfhtml.teamone.de/ online. but it's all written in german. i wonder why it's not translated in english anyway?
christoph
[ October 17, 2002: Message edited by: christoph weingarten ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic