Notes Ninjas Notes Ninjas
Lotus Notes hints, tips, error messages
Browser Window Size

Hint Short Cut: Add this to your code & documentation to help you find this page.
http://www.notesninjas.com/#BrowserSize or http://www.notesninjas.com/A555F9/nn.nsf/ByAlias/BrowserSize


Here is some javascript code to get (and open a new window with ) the web browser's current window size. Works for ie and firefox.





After checking out a few places the best results are gained by using:

document.body.clientHeight  and document.body.clientWidth

These seem to work with all browsers except Netscape 4.

 

document.documentElement.clientHeight and document.documentElement.clientWidth

are also worth trying, but do not work for ie 5 & some ie 6 browsers.

 

I did try:

window.innerHeight  and window.innerWidth

but these do not work with ie at all, and so are pretty useless.

 

I used this with

docprint = window.open(url, "modal", "height="+document.body.clientHeight+", width="+document.body.clientWidth);

docprint.focus();

 

More Information: http://www.howtocreate.co.uk/tutorials/javascript/browserwindow

 

 Jump to:     Notes Tips
    Lotus Notes Index 
  Register for Tips
Previous Lotus Notes Tip 
    Next Lotus Notes Tip
Your company logo here?
Adam Foster
Free Cash Making Web Site
Free Revenue Earning Blog Site
 Free Revenue Earning Newsletter Site   
Free Search Pages Free Web stats
Free Contact Us page
Cheap .com domain names
 Need a website or 
   Lotus Notes
  problem solved?
Adam Foster
Lotus Notes 5 All-in-one Certification Exam Guide by Libby Schwarz, Ben Malekzadeh
Sort out your CLP with this book.
See at: Amazon.co.uk | Amazon.com |