Super Tiny jQuery Plugin For Sticky Elements - Sticky

File Size: 4.34 KB
Views Total: 1325
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Super Tiny jQuery Plugin For Sticky Elements - Sticky

Sticky.js is an ultra-light (~2kb unminified) jQuery plugin that makes it easy to stick any Html elements to the top of the web page during scrolling.

How to use it:

1. Include jQuery library and the jQuery sticky.js script into your document.

<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="sticky.jquery.js"></script>

2. Call the function on the element to make it sticky on the top of the web page.

$('.container').sticky();

3. The offset option to set the distance in pixels between element and top of screen.

$('.container').sticky(20); // 20px

Change log:

2016-06-30


This awesome jQuery plugin is developed by happyproff. For more Advanced Usages, please check the demo page or visit the official website.