The position utility
The position utility is a powerful stand-alone utility that is used to position any element relative to the window, the document, a specific element, or the mouse pointer. It is unique among library components, in that it doesn't require jquery.ui.core.js
or jquery.effects.core.js
as dependencies.
It exposes no unique or custom methods (other than the position()
method), and fires no events, but it does come with a series of configuration options that allow us to use it. These options are listed in the following table:
Option |
Format |
Used to |
---|---|---|
at |
string |
Specify the edges of the element that is being positioned against. Formatted as, for example, left bottom. |
collision |
string |
Move the positioned element to an alternative position when the positioned element overflows its container. |
my |
string |
Specify the edges of the element being positioned that are expected to be aligned to the element being positioned against, for example right top. |
of |
selector, jQuery, object... |