Instance Settings

Customise each targeted paragraph with the settings below (all are optional):

$(selector).sticky({marginTop: 50});
NameTypeDefaultComments
boundedBystring 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.
marginTopnumber0 Any additional space reserved at the page top (pixels). The sticky element won't move above this position.
scrolledfunctionnull 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.

$(selector).sticky({scrolled: function(status) {
	$('#status').text(status);
}});
Functions

destroy | option (get) | option (set) | setDefaults

SignatureReturnsComments
$.sticky.setDefaults(settings)Sticky Element object Update the default instance settings to use with all further sticky element instances.
$(selector).sticky('option', options)jQuery object Update the settings for the sticky element instance(s) attached to the given element(s).

options (object) the collection of new settings.

$(selector).sticky('option', {boundedBy: '#main', marginTop: 20});
$(selector).sticky('option', name, value)jQuery object Update a particular setting for the sticky element instance(s) attached to the given element(s).

name (string) the name of the setting to change;
value (any) the new value of that setting.

$(selector).sticky('option', 'marginTop', 20);
$(selector).sticky('option', name)object or any Retrieve one or all of the current settings for the first sticky element instance attached to the given element(s).

name (string, optional) the name of the setting to retrieve; omit for all settings.

var settings = $(selector).sticky('option');
var marginTop = $(selector).sticky('option', 'marginTop');
$(selector).sticky('destroy')jQuery object Remove the sticky element functionality from the given element.