<html><div style='background-color:'><DIV class=RTE>
<P>Hi Nick,</P>
<P>Thanks for the response. I knew it was not an easy subject after looking for help on google for about an hour.</P>
<P>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.</P>
<P>Thanks again,</P>
<P>Alan...<BR><BR></P></DIV>
<DIV></DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #a0c6e5 2px solid; MARGIN-RIGHT: 0px"><FONT style="FONT-SIZE: 11px; FONT-FAMILY: tahoma,sans-serif">
<HR color=#a0c6e5 SIZE=1>
<DIV></DIV>From: <I>Nick Fitzsimons <nick@nickfitz.co.uk></I><BR>Reply-To: <I>"\[JavaScript List\]" <javascript@LaTech.edu></I><BR>To: <I>"\[JavaScript List\]" <javascript@LaTech.edu></I><BR>Subject: <I>Re: [Javascript] X and Y co-ordinates of an object</I><BR>Date: <I>Mon, 26 Feb 2007 16:41:48 +0000</I><BR>>On 26 Feb 2007, at 15:58:38, Alan Easton wrote:<BR>><BR>>>Hi All,<BR>>><BR>>>I am wanting to know the X and Y co-ordinates of an object on a <BR>>>page. It needs to be Firefox, Netscape and IE compatible.<BR>>><BR>><BR>>Welcome to a world of pain :-(<BR>><BR>>You might want to start at ppk's site:<BR>><http://www.quirksmode.org/js/elementdimensions.html><BR>>where a look at the compatibility table and associated notes
should <BR>>serve to convince you that this is not as easy as you might expect.<BR>><BR>>In particular, things get complex very quickly if the page has been <BR>>scrolled, if relative or absolute positioning are used, if elements <BR>>within the page are scrolled independently using the CSS "overflow: <BR>>auto;" or "overflow: scroll;" properties, and if iframes get <BR>>involved. And then there are various off-by-a-few-pixel bugs in <BR>>different browsers.<BR>><BR>>Then have a look at lines 187 to 253 of the dom.js file in the <BR>>Yahoo! User Interface Library:<BR>><http://developer.yahoo.com/yui/><BR>>which is pretty much bulletproof, but may have dependencies on other <BR>> parts of the library. It should at least serve to give you an idea
<BR>>of the approach to follow, if you want to write it yourself.<BR>><BR>>(Note that other JS libraries include similar functionality, so you <BR>>might want to look at their source, as well.)<BR>><BR>>HTH,<BR>><BR>>Nick.<BR>>--<BR>>Nick Fitzsimons<BR>>http://www.nickfitz.co.uk/<BR>><BR>><BR>><BR>>_______________________________________________<BR>>Javascript mailing list<BR>>Javascript@LaTech.edu<BR>>https://lists.LaTech.edu/mailman/listinfo/javascript<BR></FONT></BLOCKQUOTE></div><br clear=all><hr>Get Hotmail, News, Sport and Entertainment from MSN on your mobile. <a href="http://g.msn.com/8HMBENUK/2749??PS=47575" target="_top">Click Here!</a> </html>