Scroll Lock is a jQuery plugin that fully addresses the issue of locking mouse wheel scroll inside a given container, preventing it from propagating to parent element.
View demo
-
It does not change wheel scrolling speed, user experience will not be affected.
-
You get the same behavior regardless of the OS mouse wheel vertical scrolling speed.
On Windows it can be set to one screen or one line up to 100 lines per notch.
// Lock
$('target').scrollLock();
// Unlock
$('target').scrollLock('off');
// .scrollLock(toggle, selector, force);
// @toggle: any true value other than 'off' to lock, otherwise unlock
// @selector: string to filter the descendants of the selected elements
// @force: forces lock even if element doesn't have a vertical scroll
// lock all divs inside a given container
$('#container').scrollLock('on', 'div');
bower install jquery-scrollLock
PM> Install-Package jquery-scrollLock
Have a suggestion or a bug ? please open a new issue.