0.0.1 • Published 8 years ago

sticker v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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:

    KeyDescriptionDefault
    containerElementThe DOM element that contains elementnull
    stickyAboveViewportClassNameClass name to add to element when it is sticky and above the viewportsticker--sticky-above-viewport
    stickyClassNameClass name to add to element when it is sticky and within the viewportsticker--sticky
    topOffsetThe scroll offset at which the element becomes sticky0

Installation

Install via npm:

$ npm i --save sticker

License

MIT