jQuery plugin positioning v1.1

    A little earlier I wrote an article here about the positioning plugin. Recently, there is a need to use some other functions.
    I present to you an improved version of this plugin:
    - you can set the shift not only in pixels, but also in percent;
    - in the centering method you can set centering only horizontally, only vertically, or both horizontally and vertically.

    There are 2
    positioning methods in the plugin (leftOffset, topOffset, scroll) - positions an element on the page

    leftOffset - horizontal
    shift topOffset - vertical shift
    scroll - a parameter that sets positioning relative to the “absolute” top left point of the browser, or positioning relative to the top left point of an already scrolled page.

    centering (horisontalAlign, verticalAlign) - positions the element in the center of the page.

    You can see an example here.
    At the bottom of the page there are 3 buttons - clicking on them you can see the plugin in action

    Also popular now: