StickyStack
Demo
Make you reading context, titles, and subtitles stick while user scroll the page -Usage
Plain use:
Browserify, Webpack, etc.
StickyStack =
Make stuff sticky
// make .header stick at the top of the page, .title, and .subtitle to followvar stickyStack = '.header''.title' '.subtitle'
// clean up when donestickyStack
Important: Sticky stack makes things sticky. You still have to style the elements to make it look good. For example:
//
API
StickyStack([first level elements, second level elements, ... ], options)
Constructor var stickyStack = '.title' '.subtitle' 'h3'
- elements[array/string] - an array of elements, grouped by desired level in stickiness stack. Each element can be
- CSS selector for desired elements
- DOM element
- Array of DOM elements
- options:
- offset: the initial offset of the sticky stack. Distance from the head of the parent object
StickyStack.prototype.refresh()
Recalculate and reposition all elements. Use this after a change in the page have changed the horizontal positioning of elements.
StickyStack.prototype.destroy()
Removes sticky stack effect from page.