Is it possible to tell if the user of a website is using multiple monitors? I need to find the position of a popup but it's quite likely the user will have a multiple monitor setup. Whilst window.screenX
etc. will give the position of the browser window it's useless for multiple monitors.
views:
748answers:
5I do not believe that it is possible right now; however js is becoming more popular for desktop use in widgets in addition to web development and that would be an excellent feature to request for a future version
I found this as a solution that someone has used... I do not see why you couldn't trust it.
[if the width is greater then (Height/3) * 4 > (Screen.Width) THEN]
[User has dual monitor]
[End If]
You can't do that. You could position the popup centered on the parent window however. I think it's a better idea to show a "div" as dialog in the middle of your website, because the chance that this is popup blocked is smaller and it's IMO less annoying.
What about the size of the screen? Multiple screens have usually a great size. Just check the sizes and decide if it's reasonable to be on just one or more screens.
You could make a well-educated guess with JavaScript's screen.width
(.availWidth
) and screen.height
(.availHeight
).
My idea was to assume (!) that monitors in general follow a certain ratio, whereas the .[avail]width should be outside of it because the screen is duplicated only in terms of width, but not height.
Writing this answer, it sounds like a severe hack though. Nothing I would really rely on.