kafe.plugin.sticky

Class

Version 0.2.0

Sticky box

Source: dist/plugin/sticky.js

Methods

init

Initialize sticky (has to be position:absolute with defined top left|right by default).

init
  • options

Parameters:

  • options Object

    Additional options.

    • selector String|jQueryObject|DOMElement

      Element to stick.

    • [align = 'auto'] String Optional

      Specify left or right if your horizontal absolute positioning uses left or right instead of auto.

    • [contain = false] Boolean Optional

      If true, the sticky will become scrollable when it reaches the bottom edge of its container.

    • [container = PARENT] String|jQueryObject|DOMElement Optional

      Container in which to constrain the sticky.

    • [topBuffer = 0] Number Optional

      Buffer in pixels before sticking occurs.

Example:

kafe.plugin.sticky.init({ selector: '#post-it' })
$('#post-it').kafeSticky('init', {})