Given an HTML DOM ID, how to get an element\'s position relative to the window in JavaScript/JQuery? This is not the same as relative to the document nor offset parent sinc
This sounds more like you want a tooltip for the link selected. There are many jQuery tooltips, try out jQuery qTip. It has a lot of options and is easy to change the styles.
Otherwise if you want to do this yourself you can use the jQuery .position()
. More info about .position()
is on http://api.jquery.com/position/
$("#element").position();
will return the current position of an element relative to the offset parent.
There is also the jQuery .offset(); which will return the position relative to the document.