> How to get the actual screen coordinates from logical coordinates in
> Posted by: "rockmohit" rockmohit%40yahoo.co.uk">rockmohit
yahoo.co.uk rockmohit
> Date: Fri Oct 19, 2007 8:59 am ((PDT))
>
> Hi All.
>
> How can we get the actual screen coordinates for an html element.
> Say for a html element on a scrollable web page the coordinates that we
> get from javascript functions would be 106,200.
> And the actual screen co-ordinates would be, say 100,190.
>
> Now if the page is scrolled, the logical co-ordinates got thru
> javascript functons would still give 106,200. But the actual screen
> coordinates would have changed. (depending on the page being scrolled
> up or down)
>
> I want to derive exactly these screen coordinates for that html
> element. Is there any function/mechanism through which i can get these
> cordinates or perform conversion?
>
> Any guidance is appreciated.
>
> thanks
You might find the properties of the window.screen object useful:
Property: height; value: 800
Property: width; value: 1280
Property: availHeight; value: 732
Property: availWidth; value: 1280
Property: colorDepth; value: 24
Property: top; value: 0
Property: left; value: 0
Property: pixelDepth; value: 24
Property: availLeft; value: 0
Property: availTop; value: 0
Output is from Firefox 2.0.0.8 on 32-bit SuSE Linux 10.2. I've no easy
way to see what the available properties are in MSIE, but you should be
able to determine these easily enough through introspection.
cheers
jon.
--
This message has not been scanned for viruses.
Since I do not use a Microsoft operating
system or software, and use only plaintext
for email, there is little need for me to do so.
.