[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: element coordinates in html output

Subject: RE: element coordinates in html output
From: "Arthur Bogaart" <Arthur@xxxxxxxx>
Date: Tue, 5 Mar 2002 12:33:36 +0100
javascript element coordinates
Hi Maros,

As far as I know it's quite easy in ie5+. You should give the elements you would like to access an id attribute. Then you'll be able to get their x,y coordinates like this.

document.getElementById(elementId).style.posLeft;

and

document.getElementById(elementId).style.posTop;

For more information see http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/postop.asp?frame=true


In netscape 4.x you'll only have coordinates access to <div/>,<span/>,<layer/> and <ilayer/> tags. 
In netscape6 this should do the trick.
var leftpos = parseInt(document.getElementById(elementId).style.left);

For more netscape info see
http://developer.netscape.com/evangelism/docs/articles/updating-dhtml-web-pages/#codefork
http://www.mozilla.org/docs/dom/domref/

If you're only consurned about positioning layers (div/span/layer) you could also take a look at the DynAPI. http://dynapi.sourceforge.net It's a Cross-Browser DHTML Library.


> Hi,
>      I need to get the coordinates of any of html elements in 
> XSLT output. I tried to use JavaScript Anchor.x property, but 
> it seams that either netscape nor mozilla nor IE nor Opera 
> does implement JavaScript 1.2 properly.
> 
> Does anybody know the way to get the coordinates?
> 
> Thanks in advance.
> 
> 	Maros Ivanco.


kind regards,

Arthur Bogaart

Hippo Webworks
Grasweg 35
1031 HW Amsterdam
Tel  +31 (0)20 6345173 
Fax +31 (0)20 6345179

arthur@xxxxxxxx / www.hippo.nl
 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.