I need the x, y coordinates of my document element in dart. I tried .clientTop
and .clientLeft
without success. window.screenLeft
and screenTop
is also important, if the window, is not maximized and is somewhere on the screen.
Asked
Active
Viewed 110 times
0
-
Do you mean document or window? – Liam Jun 02 '14 at 10:04
-
Hi, look at the picture. I need the coordinate relative to the 0, 0 point of the screen. – Kronos Jun 02 '14 at 10:06
-
screenLeft and screenTop only contains the window coordinates. This is important too for me, But the height of the title and address bar aren't considered. – Kronos Jun 02 '14 at 10:09
-
1possible duplicate of [Get screen coordinates of DOM element](http://stackoverflow.com/questions/15703625/get-screen-coordinates-of-dom-element) – Günter Zöchbauer Jun 02 '14 at 10:38
-
"look at the picture. I need the coordinate relative to the 0, 0 point of the screen" - Your image shows the document offset, not screen offset. – Robert Jun 02 '14 at 13:33
-
Can you tell a bit about your use case, what you try to accomplish? – Günter Zöchbauer Jun 02 '14 at 13:42
1 Answers
2
This is as close as I can get for the height:
num offHeight = window.screenTop + window.outerHeight - window.innerHeight;

Kronos
- 141
- 1
- 11