W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2016

Re: [whatwg] window.innerScreenX and window.innerScreenY

From: Jonathan Zuckerman <j.zuckerman@gmail.com>
Date: Tue, 13 Dec 2016 14:09:11 +0000
Message-ID: <CAPP4rD_nDtHsFW+JAnNRguUj87baG5w1=3JK7R4p52RKDX49cQ@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>, whatwg@lists.whatwg.org
Ah right.. would it be possible to compute the missing dimensions given a
mouse event with screenX/Y and clientX/Y properties?

On Tue, Dec 13, 2016 at 9:03 AM Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 12/13/16 8:46 AM, Jonathan Zuckerman wrote:
> > Jan, does window.screenX/screenY not meet your needs?
> > https://developer.mozilla.org/en-US/docs/Web/API/Window/screenX
> > https://developer.mozilla.org/en-US/docs/Web/API/Window/screenY
>
> That doesn't work because it gives the screen position of the top/left
> edge of the browser window, not of the content are the web page is
> rendered into.  So if you have a screen coordinate and you want to
> translate it into page-relative coordinates, this won't do what you
> want: you'll be off by the size of the window decorations and the
> browser chrome.
>
> -Boris
>
Received on Tuesday, 13 December 2016 14:09:54 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:40 UTC