PDA

View Full Version : getting x y coordinates of images in javascript


flashgaul
01-08-2003, 06:39 AM
Hi, all

I have got 5 image links in my index page(HTML).
Now click of each of those links opens up a swf. Now I want to play the swf at precisely the same position where the image link is there. Even when the browser window is resized or scaled.

Hence I looking for some way in javascript through which we can determine the X, Y coordinates of those Images in the hTML document so that I can place the swfs accordingly.

Pls help

Thx


__________________

brothercake
01-08-2003, 12:55 PM
You need a recursive function, like this one (http://www.webreference.com/js/column33/image.html)


Note that, due to a bug in the mac version of ie5, the co-ordinates it returns may be incorrect by an inverse of the page's body margins, which requires manually compensating for.

flashgaul
01-08-2003, 02:04 PM
Hi brothercake,
Thats precisely what I was looking for.

But I know nothing abt javascript can u tell me how to use these functions to get an images x y coordinate. Mayb with a small eg.

This would be a great help to me.

Thx