jQuery Plugin To Enable / Disable Scrolling Behavior - Lock Scroll

File Size: 4.56 KB
Views Total: 7819
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
jQuery Plugin To Enable / Disable Scrolling Behavior - Lock Scroll

Lock Scroll is a super tiny jQuery plugin which allows you to disable / enable scrolling behaviors (vertical, horizontal or both) on a scrollable area.

How to use it:

1. Load the jQuery lock scroll plugin after jQuery library.

<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="js/jquery.lockscroll.min.js"></script>

2. Disable both vertical and horizontal scrolling.

$('#container').lockscroll(true);

3. Disable vertical scrolling.

$('#container').lockscroll(true, 'vertical');

4. Disable horizontal scrolling.

$('#container').lockscroll(true, 'horizontal');

5. Destroy the plugin.

$('#container').lockscroll(false);

Changelog:

2018-09-30

  • Rebuilt

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