Simple & Versatile Sticky Element Plugin For jQuery - scroll-follow

Simple & Versatile Sticky Element Plugin For jQuery - scroll-follow
File Size: 361 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

scroll-follow is a simple yet highly customizable and mobile-friendly jQuery plugin to create sticky elements that follow as you scroll down the page. Ideal for sticky navigation, fixed sidebar and more.

Basic usage:

1. Load the main JavaScript file jquery.simple-scroll-follow.js after jQuery library and we're ready to go.

<script src="//code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="jquery.simple-scroll-follow.js"></script>

2. The JavaScript to make your sidebar sticky on vertical page scrolling.

$('.sidebar').simpleScrollFollow();

3. The JavaScript to make your sidebar sticky within a specific container.

$('.sidebar').simpleScrollFollow({
  limit_elem: 'article'
});

4. Disable the 'sticky' functionality when the screen size is less than 992px.

$('.sidebar').simpleScrollFollow({
  min_width: 992
});

5. Enable/disable the 'sticky' functionality:

// enable
$('.sidebar').simpleScrollFollow('setEnabled', true);

// disable
$('.sidebar').simpleScrollFollow('setEnabled', false);

Changelog:

2018-08-12

  • v3.1.2: Bugfix

2017-05-14

  • v3.1.0

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