[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: element coordinates in html output
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|