How to determine x,y of and Anchor
Hi, I have to migrate a menu function cuurently working fine in NS 4.x to IE. What I am looking for is how to determine the x,y coordinate of an HTML anchor, I've combed JScript reverences to no avail. I use the following for NS:
document.mylayer.visibility = "visible"
// anchorName is is filled by backend
// script builder...
xname = "document.anchors."+anchorName+".x"
yname = "document.anchors."+anchorName+".y"
eval("x = " + xname)
eval("y = " + yname)
I'd appreciate any info on how to accomplish the same for IE...
Thanks in advance and best regards,
In the generation 6+ browsers
object.offsetLeft and obj.offsetTop will give you the required info
Thanks Dave, Khalid Ali for responding. I had investigated the offsetLeft and offsetTop and wondered why 1 was always returned.
Dave thanks for the link... the loop on the offset.parent to get the true offset worked.
Dave, FYI, I inherited the initial code and just wrote the back-end script processor around it a few years ago. Now that I have to mess with it I will definately incorporate your suggestion...
Self proclaimed halffast web programmer...
Sorry guys I would have responded sooner, for some reason I couldn't get through the FW until today...
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)