cross browser x,y

T

tascien

question I have never been able to solve since the 90s...

I want to find x, y location of a layer or an image, or any other item
on a webpage.

1. It could be relatively or absolutely positioned.
2. It does not matter what browser the user is using.

what's the correct javascript code?

example: find x, y location of the image "someImage"

<html>
<body>
......... some html here....

<img src="someImage.gif" id="someImage" />
......... some html here....
<body>
</html>

any help?
 
C

cwdjrxyz

question I have never been able to solve since the 90s...

I want to find x, y location of a layer or an image, or any other item
on a webpage.

1. It could be relatively or absolutely positioned.
2. It does not matter what browser the user is using.

what's the correct javascript code?

example: find x, y location of the image "someImage"

<html>
<body>
........ some html here....

<img src="someImage.gif" id="someImage" />
........ some html here....
<body>
</html>

I use a program called ScreenCalipers that might be of use to you. You
can download a limited feature version for free at
http://www.iconico.com/caliper/v3upgrade.aspx . Paying for it will add
more features. You can measure the x and y distances between any two
points in px, cm, inches, or other units. A measurement from the left
of the screen to the start of an image will give the x coordinate for
the image, and measurement from the top of the screen to the top of the
image will give the y coordinate. You can also measure the width and
height of the image. I do not know exactly what code is used in the
ScreenCalipers program, but it seems to work well for me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top