set absolute position on panel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can the absolute position be set when a button is hit. I have a help
pannel that i want to appear next to the "?" button that is selected.

thanks
any ideas would be appreciated
kes
 
set
obj.style.top = x;
obj.style.left = y;

to find the x and y of an object:


window.getYPos = function(obj){
var curtop = 0;
if (document.getElementById || document.all) {
while (obj.offsetParent) {
curtop += obj.offsetTop;
if (typeof(obj.scrollTop) == 'number')
curtop -= obj.scrollTop;
obj = obj.offsetParent;
}
}
else if (document.layers)
curtop += obj.y;
return curtop;
}
window.getXPos = function(obj) {
var curleft = 0;
if (document.getElementById || document.all) {
while (obj.offsetParent) {
curleft += obj.offsetLeft
obj = obj.offsetParent;
}
}
else if (document.layers)
curleft += obj.x;
return curleft;
}

-- bruce (sqlwork.com)
 
Back
Top