0

I use a screenshot tool like SnagIt and this tool is able to make a screenshot of a specific element inside a website. I tried this feature with firefox, safari and ie, all runs fine. When I use the mouse pointer to aim an element, SnagIt shows a red box around the hovered element in the browser. For example, this tool knows the exact coordinates of a div or img element.

What is the technique behind this feature? Is there a common way for every browser? I've already used Spy++ to get the window handles, unfortunately this isn't the resolution.

I'm in a project in which I need this feature for different browsers.

Thank you very much, Mark

4

1 に答える 1

-1

JavaScript の任意の要素の x、y 座標を知りたい場合は、ページで jquery [ http://jquery.com]を使用し、そのオフセット関数を使用することをお勧めします。

于 2010-07-31T15:43:49.440 に答える