Skip to content
This repository has been archived by the owner on Jan 11, 2022. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
rgalus committed Jan 30, 2017
1 parent e004641 commit a366e88
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
[![npm version](https://badge.fury.io/js/sticky-js.svg)](https://badge.fury.io/js/sticky-js)
[![Bower version](https://badge.fury.io/bo/sticky.js.svg)](https://badge.fury.io/bo/sticky.js)

[DEMO](https://rgalus.github.io/sticky-js/)
> Sticky-js is a library for sticky elements written in vanilla javascript. With this library you can easily set sticky elements on your website. It's also responsive.
Sticky-js is a library for sticky elements written in vanilla javascript. With this library you can easily set sticky elements on your website. It's also responsive.
[DEMO](https://rgalus.github.io/sticky-js/)

## Features

- Written in vanilla javascript, no dependencies needed
- Lightweight (minified: ~5.28kb, gzipped: ~1.48kb)
- Lightweight (minified: ~5.72kb, gzipped: ~1.63kb)
- It can be sticky to the entire page or to selected parent container
- No additional CSS needed

Expand Down Expand Up @@ -87,13 +87,15 @@ Update sticky, e.g. when parent container (data-sticky-container) change height
```js
var sticky = new Sticky('.sticky');

// and when parent change height..
sticky.update();
```

## Available options

Option | Type | Default | Description
------ | ---- | ------- | ----
data-sticky-wrap | boolean | false | When it's `true` sticky element is wrapped in `<span></span>` which has sticky element dimensions. Prevents content from "jumping".
data-margin-top | number | 0 | Margin between page and sticky element when scrolled
data-sticky-for | number | 0 | Breakpoint which when is bigger than viewport width, sticky is activated and when is smaller, then sticky is destroyed
data-sticky-class | string | null | Class added to sticky element when it is stuck
Expand Down

0 comments on commit a366e88

Please sign in to comment.