Gervase Markham <[EMAIL PROTECTED]> wrote: > Xiaolei Li wrote: > >> hi, i'm writing an app that needs the coordinates of DOM elements. >> given some DOM node (image, text, table, etc.) and the rendered page, >> i'd like to find out the coordinate of the upper-left hand corner and >> the width/height of the node. is there API to do this? thank you. > > Coordinates relative to what? Are you in JS, C++ or a web page?
relative to the upper left hand corner of the webpage, which i guess is (0, 0). basically, it's as if i took a screenshot of the rendered page and wanted to know the coordinates of everything. i'm doing this in C++. > You could call getComputedStyle and look at the top and left > properties, which I believe are the offsets in px relative to the > containing box. cool. thank you. -- Xiaolei Li | [EMAIL PROTECTED] | www.xiaolei.org _______________________________________________ Mozilla-xpcom mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-xpcom
