npm.io
0.0.1 • Published 10 years ago

sticker

Licence
MIT
Version
0.0.1
Deps
1
Vulns
0
Weekly
0

sticker npm Version Build Status

Effortless sticky DOM elements.

Example

$ git clone https://github.com/yuanqing/sticker
$ npm install
$ npm install --global gulp
$ gulp example --open

API

import sticker from 'sticker';
sticker(element [, options])
  • element — A DOM element.

  • options — An optional object literal:

    Key Description Default
    containerElement The DOM element that contains element null
    stickyAboveViewportClassName Class name to add to element when it is “sticky” and above the viewport sticker--sticky-above-viewport
    stickyClassName Class name to add to element when it is “sticky” and within the viewport sticker--sticky
    topOffset The scroll offset at which the element becomes “sticky” 0

Installation

Install via npm:

$ npm i --save sticker

License

MIT

Keywords