[jQuery] UI Dialog Position Based on Link Position

[jQuery] UI Dialog Position Based on Link Position


I'd like to open a dialog when a link is clicked, and have the dialog
open beside the link, similar to a tooltip.
Are there any examples on how to calculate the position where the
dialog should show up? What's the best way to position it so that it
shows within the confines of the page (i.e. if the link is right-
aligned, the dialog should popup to the left of the link, etc.).