Hi, I was wondering if there is a way to obtain an objects x and y coordinates. In other words, is there a way to get the coordinate of the top-left corner of the object on the HTML page? I would like to have a function for a drop-down menu which accepts a menuID. So, the function would look like:
function show_menu(menuID){
//get the x coordinate of the calling variable (ie, this)
//get the y coordinate of the calling variable (ie, this)
...
}
I was trying to use the "style" attribute on the calling variable (ie, this.style.top/left) to get the x and y coordinates, but it didn't seem to work. If there's a good way to do this, please let me know
Thanks in advance,
--URL
function show_menu(menuID){
//get the x coordinate of the calling variable (ie, this)
//get the y coordinate of the calling variable (ie, this)
...
}
I was trying to use the "style" attribute on the calling variable (ie, this.style.top/left) to get the x and y coordinates, but it didn't seem to work. If there's a good way to do this, please let me know
Thanks in advance,
--URL