-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello,
Suppose I have components A, B (hidden), C. I want to rollover A and show B (probably a Window) positioned a certain distance from C. I would like to do this with a CSA, though not totally necessary. I can hide and show with "action" but I don't know how to position it. Is there some cross-browser support for getting the position of any component? Something in "action", "anima", Effect, etc.? I don't want to write and maintain my own solution.
Thanks.
/Daryl
Doing something like this:
window.setPosition("parent"); window.setLeft("10px"); window.setTop("-20px");
function getXYpos(elem) { if (!elem) { return {"x":0,"y":0}; } var xy={"x":elem.offsetLeft,"y":elem.offsetTop} var par=getXYpos(elem.offsetParent); for (var key in par) { xy+=par; } return xy; }
Asked: 2009-07-24 15:31:48 +0800
Seen: 268 times
Last updated: Jul 27 '09