Somewhat earlier I wrote an article about positioning plugin here. Recently there was a need to use some other features.
I present to you the improved version of this plugin:
- you can set the shift not only in pixels, but also in percentage;
- in the centering method, you can set the centering only horizontally, only vertically, or both horizontally and vertically.
Plugin has 2 methods
positioning (leftOffset, topOffset, scroll) - position the element on the page
leftOffset - horizontal shift
topOffset - vertical shift
scroll is a parameter that specifies the positioning relative to the “absolute” upper left point of the browser, or positioning relative to the upper left point of the already scrolled page.
')
centering (horisontalAlign, verticalAlign) - positions the element in the center of the page.
An example can be found
here.
At the bottom of the page there are 3 buttons - clicking on them you can see the plugin in action