homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

visitorís screen size
with multiple monitors

 6:39 pm on Mar 28, 2006 (gmt 0)

I donít have the setup to test this, hence the question:
Letís say that a visitor has two monitors - if you try to get visitorís screen size with JS code
(window.screen.width and window.screen.height) what will the result be? Is it just the size of the area of their browser, data for only one monitor, or data for both monitors combined, or..?



 7:54 pm on Mar 28, 2006 (gmt 0)

It would be the same for both, wouldn't it? You can't open a window to be one size in one monitor and a different size in another.


 9:08 pm on Mar 28, 2006 (gmt 0)

It depends on how the multiple monitors are setup. Each could has different resolution.


 9:24 pm on Mar 28, 2006 (gmt 0)

Sorry. Misread.


 9:34 pm on Mar 28, 2006 (gmt 0)

It will be the size of the current application's portion of the desktop. Thus, if you have two monitors with a 1600◊1200 resolution, it is not going to show 3200◊1200, but instead only the resolution for the monitor in which the app currently runs. This can, certainly, as has already been mentioned, be different between the two.


 9:37 pm on Mar 28, 2006 (gmt 0)

Actually ... Just did another test. If you have it set to allow windows to span the two monitors (thus maximizing over both monitors instead of the normal one) it will show the combined total, which in this case can be completely different than the two resolutions combined, as it will take into account dead space from adjusting the desktops height wise.

It also depends on the video card, whether you have only one or two ... and (if one) whether it is capable of treating both monitors as one single desktop internally.


 10:10 pm on Mar 28, 2006 (gmt 0)

In Safari Version 2.0.3 (417.9.2) and Firefox/ under Mac OS X 10.4.5, the monitor size reported is whichever monitor contains the majority of the current window's area.

I suspected it would report whichever monitor contained the upper left hand corner of the window, so the result was quite surprising to me.


 1:46 am on Mar 29, 2006 (gmt 0)

Thanks for the info and tests; I was especially after the info provided by DrDoc and whoisgregg in the last two posts.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved