views:

37

answers:

2

Hello,

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

A: 

If you want to know the x,y coordinates of any element in javascript, Then I suggest you use jquery [http://jquery.com] on your page and use its offset function.

Coffee Bite
This site I want to analyse is not my own. So I can't integrate jquery into this site, can I?
Mark
A: 

Have a look at this question

Ivan Kruchkoff