I have a page that has layers. I use the following function to move layers to a specific location (next to a button that was pressed).
Code:
[code=php]
function moveIt(id) {
it = document.getElementById(id);
it.style.top = event.srcElement.offsetTop;
it.style.left = event.srcElement.offsetLeft + event.srcElement.offsetWidth + 5;
it.style.visibility = (it.style.visibility == “visible”) ? “hidden” : “visible”;
//it.style.visibility = “visible”;
}
The moving of a layer works fine if I have my buttons not in a table. As soon as I wrap a table around buttons, layer appears always in one position (0,200) no metter which button I press. event.scrElement.offsetTop and event.scrElement.offsetLeft always return 1 ans 208 no metter which button I press.
How’s table interfering with calculating button positioning?
thanks,
camokat