Sticky Any Element Plugin with jQuery

Sticky Any Element Plugin with jQuery
File Size: 8.07 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT

A simple and easy-to-use jQuery Plugin that makes it easy to make any element on your page follow the user down the page as they scroll.

How to use it:

1. Include jQuery Library and sticky.js

<script type="text/javascript" src=""></script>
<script type="text/javascript" src="jquery.sticky.js"></script>

2. Call the plugin

$("#sticker").sticky({ topSpacing: 0, center:true, className:"hey" });

3. The basic Markup

<div id="sticker">
<p> sticky content</p>

4. All possible plugin options.

  topSpacing: 0,
  bottomSpacing: 0,
  className: 'is-sticky',
  wrapperClassName: 'sticky-wrapper',
  center: false,
  getWidthFrom: '',
  widthFromWrapper: true, // works only when .getWidthFrom is empty
  responsiveWidth: false,
  zIndex: 'inherit'

Change log:


  • Subtract element padding in getWidthFrom.

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