Responsive Any Element Sticky Plugin For jQuery - sticky-items

File Size: 95.3 KB
Views Total: 1207
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Responsive Any Element Sticky Plugin For jQuery - sticky-items

Yet another jQuery plugin that makes any matched html elements floating and sticky at the top of the webpage as you scroll down. The plugin gets the current position of the item on the page, so that it will only stick to the top from that point down. It also has the ability to re-calculate the scroll position on window resize so that it works on any responsive web layout and even mobile devices.

Basic usage:

1. The plugin requires jQuery library 1.12+ to work:

<script src="//"></script>
<script src="res/js/sticky.js"></script>

2. Call the stickyItem function on the desired element. A '.is-sticky' CSS class will be added to the matched element if it becomes sticky.


3. Set the top offset in pixels when the element becomes sticky.


4. Set the background color of your sticky element.

  background: '#ffffff'

5. Set the original width for your responsive design. If the browser window is smaller than the item's original size, the plugin will set the current width to the window size ;else set to originalWidth.

  background: '#ffffff'

6. Set the z-index.

  layer: 99

7. All default config options.


  top: 0,
  left: 'autoload',
  background: 'transparent',

  // sticky item max-width setting, is responsive by default up to max-width
  originalWidth: 0,

  // z-index layer
  layer: 99,

  // extend styles for the parent element
  parentStyles: {},

  // extend styles for the item element
  itemStyles: {},

  // extend styles for the children element(s)
  childrenStyles: {},

  // debug mode
  debug: false

Change log:


  • Added extra feature to include a named wrapper around the item inside of the initial wrapper.


  • fix bug when initializing the element for the first time.


  • updated sticky js with new functions

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