views:

32

answers:

1

I want to detect the monitor resolution with javascript. This works fine with screen.height and screen.width on the primary monitor. On a secondary monitor (extended desktop) this doesn't work! When I move the browser to the secondary monitor and call my javascript function with the resolution detection, screen.height and screen.width have still the resolution values of the primary monitor.

Does anybody know a solution for this problem?

+2  A: 

Its my understanding that it will only return the values of the Primary Monitor. I believe a solution would have to come in at the browser level which would not be a Javascript based one.

michael
Yeah, the browser determines which values to return for screen.height/width. So, you'll have to petition the browser makers for detecting the browser window on the secondary monitor. Having said that, it's probably best to not rely on those properties anyway.
palswim