Hello
How do you get the x and y positions of something you have hovered your mouse over using javascript ? I am trying to make a popup, so when you hover over text, it creates a popup Window.
Thanks
How to get x and y Position
How to get x and y Position
.............................:: Spirit of Fire ::..................................
-
- Posts: 479
- Joined: Tue May 16, 2006 11:53 am
Popup
You know me, I am always posting real posts on these forums ;]! (Y) also I found what i needed, on http://www.devarticles.com/c/a/JavaScri ... -Part-I/1/ for future reference or if anyone stumbles upon this and needs to figure out how to do it.
.............................:: Spirit of Fire ::..................................
i found your answer in stackoverflow[.]com[/questions/160144/find-x-y-of-an-html-element-with-javascript] which is as follows
var **** = function (obj) {
var left, top;
left = top = 0;
if (obj.offsetParent) {
do {
left += obj.offsetLeft;
top += obj.offsetTop;
} while (obj = obj.offsetParent);
}
return {
x : left,
y : top
};
};
var **** = function (obj) {
var left, top;
left = top = 0;
if (obj.offsetParent) {
do {
left += obj.offsetLeft;
top += obj.offsetTop;
} while (obj = obj.offsetParent);
}
return {
x : left,
y : top
};
};