Getting absolute coordinates from a DOM element
Posted by: More Whidbey stuff,
on 30 Jan 2008 |
View original | Bookmarked: 0 time(s)
For some reason, there is no standard API to get the pixel coordinates of a DOM element relative to the upper-left corner of the document. APIs only exist to get coordinates relative to the offset parent. Problem is, it's very important to get those coordinates for applications such as drag and drop, or whenever you need to compare coordinates of elements that may be in completely different parts of the document. In Microsoft Ajax, we implemented such a function but it proved to be one of the most...