[Javascript] X and Y co-ordinates of an object

Nick Fitzsimons nick at nickfitz.co.uk
Mon Feb 26 11:10:32 CST 2007


On 26 Feb 2007, at 16:49:53, Alan Easton wrote:
> Hi Nick,
>
> Thanks for the response. I knew it was not an easy subject after  
> looking for help on google for about an hour.
>
> Thanks for the tips and URLs though, I will take a look and then  
> decide that if what I want to do is really worth it.
>
> Thanks again,
>
> Alan...
>

No problem. Despite my dire prognostications, if the case you're  
dealing with is a fairly straightforward one then it's not _too_  
difficult to get it working reliably. Personally, having done this  
(with the additional problem of supporting Netscape 4) in the past,  
I'm rather pleased that my client have asked me to use the YUI for my  
current project :-)

Although it's linked from the page I mentioned previously, I'll just  
point out that ppk also has an excellent article on this problem with  
a complete script function that looks good to me, at:
<http://www.quirksmode.org/js/findpos.html>

Good luck,

Nick.
> From:  Nick Fitzsimons <nick at nickfitz.co.uk>
> >>Hi All,
> >>
> >>I am wanting to know the X and Y co-ordinates of an object on a
> >>page. It needs to be Firefox, Netscape and IE compatible.
> >>
> >
> >Welcome to a world of pain :-(
> >
>
-- 
Nick Fitzsimons
http://www.nickfitz.co.uk/






More information about the Javascript mailing list