🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

A small jQuery plugin for sticky headings that makes headers of page sections stuck on the top when scrolling past them.

Sticky

Documentation

Sticky Headings

Sticky Headings its jquery based plugin. Its light weight as compared to other free plugin available on web.

How to use

  • Include jQuery lib.
  • Give any specific class to all headings i.e. class="sticky-header"
  • Initialize the plugin as $('.sticky-header').stickyheadings();

How to give offset

$('.sticky-header').stickyheadings({offset:10}); 

Callback function for each scroll

Second parameter in the arguments acts as the callback function.

$('.sticky-header').stickyheadings({},onscroll); 

Callback function after heading got stuck, i.e. onstuck

Second parameter in the arguments acts as the callback function.

$('.sticky-header').stickyheadings({},null, onstuck); 

Demo


You May Also Like