Customise each targeted paragraph with the settings below (all are optional):
$(selector).sticky({marginTop: 50});
Name | Type | Default | Comments |
---|---|---|---|
boundedBy | string or Element or jQuery | '#content' | The selector, DOM element, or jQuery collection for the element that defines the top and bottom boundaries within which the sticky element stays. |
marginTop | number | 0 | Any additional space reserved at the page top (pixels). The sticky element won't move above this position. |
scrolled | function | null | A callback function to notify of scrolling of the sticky element.
The function receives one parameter being
'top' if the sticky element is in its original position,
'float' if it is pinned to the top of the screen, or
'bottom' if it has reached the end of its range and is scrolling off the screen.
Within the function this refers to the sticky element.
|