views:

24

answers:

0

How can I get the browser window's left edge (including menu, border, caption, etc), without it being "fixed" to take into account the zoom level? (This question addresses the basic question, but does not consider zoom.).

window.screenLeft or window.screenX work fine on Chrome and Safari, but these report "fixed" values using IE6, IE8 and Firefox.

I have considered that I can get the screen's size more reliably, and perhaps determine the zoom factor using that or screen.deviceXDPI, but I am not sure how I would use that to correct the position.

(Some of you are probably wondering why I want to do this. It is because a training web site opens a browser window on the right hand side of the user's screen. The browser communicates with my application using the script tag hack. The application wants to resize itself so it fits exactly to the left of the browser window.)

EDIT

I should have mentioned two things:

  1. I am asking about the browser zooming that you can typically access from a View menu or by holding down Ctrl and turning your mouse wheel. Because most web pages are not well able to respond to changes in (for example) default font size without mucking up their layout, browsers implement zoom by scaling all measurements, including pixels. To keep things consistent, they also scale reported client and window size, mouse positions, etc. The trouble for me is that I want the real (unscaled) measures.
  2. I am looking for a JavaScript solution.