Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Nov 2005
    Posts
    85
    Thanks
    22
    Thanked 0 Times in 0 Posts

    window.screenY in a dual screen environment

    I am trying to determine how the value for window.screenY is derived on the second monitor in a windows 8.0 dual screen environment and whether or not it can be programmatically recalculated (using javascript) to return the same outcome as it would in a single screen environment.

    My test setup is a laptop with resolution 1366 x 768 running as the primary display and
    an attached monitor with resolution 1920 x 1080 running as the second display.

    Assuming a maximised browser at 100% zoom I would expect window.screenY equal to 0 (or a negative value equal to the chrome e.g. -8)
    IE10 -8
    FF -8
    chrome 0
    opera 0

    On the second monitor I am getting:
    IE10 -203
    FF -203
    chrome -195
    opera -195
    A difference of -195 in each instance.

    Presumably this difference has some relationship to the difference in the respective display heights?
    768 – 1080 = -312
    -312 / 2 = -156

    With regard to screen.height on the second display:
    IE returns the height of the primary display 768
    The other browsers return that of the second display 1080
    So in either instance there is only information about one of the displays.

    Any thoughts would be appreciated. Thanks.

    (The displays in my example match the physical set up. If I swap them round so that the larger display is position 1, then the difference of -195 I described in my question becomes -172. Maybe by co-incidence but -156 -8 -8 = -172.)

    (further to my original post I have realised that it is also possible to position displays above and below each other, in addition to left or right, which further alters the outcome for screenY. Maybe there can be no reliable use of screenY in a dual screen environment?)
    Last edited by Martins; 08-15-2014 at 03:31 PM.

  • #2
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,413
    Thanks
    11
    Thanked 595 Times in 575 Posts
    think you you've figure out about all there is not know. i thought i saw something about a simple API that would let you iterate screens, but i don't know what browser that was or when it would be coming out, or if they decided against it for privacy concerns. not too helpful, sorry. i do know that you're describing a very common gotcha without a decent or simple answer that we usually just have to test what we support and hope for the best on...
    my site (updated 2014/10/20)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.3, IE11:9.2, IE9:2.7, IE10:2.6, FF:16.8, CH:47.5, SF:7.8, NON-MOUSE:37%

  • #3
    New Coder
    Join Date
    Nov 2005
    Posts
    85
    Thanks
    22
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by rnd me View Post
    think you you've figure out about all there is not know. i thought i saw something about a simple API that would let you iterate screens, but i don't know what browser that was or when it would be coming out, or if they decided against it for privacy concerns. not too helpful, sorry. i do know that you're describing a very common gotcha without a decent or simple answer that we usually just have to test what we support and hope for the best on...
    Okay, thanks. It also seems that there is no easy way to detect dual screening in general.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •