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

Sticky Headings is a very small jQuery plugin which makes heading elements (or any other elements you prefer) fixed at the top of the webpage as you scroll 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