Need help with jquery-disablescroll?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

130 Stars 34 Forks MIT License 11 Commits 1 Opened issues


Disables scroll events from mousewheels, touchmoves and keypresses.

Services available


Need anything else?

Contributors list

# 543,965
2 commits


⚠️ No longer actively maintained

Author: Josh Harrison at Aloof

Disables scrolling from scrollbars, mousewheels, touchmoves and keypresses on a given scrollable element, typically


Use it while jQuery is animating the scroll position for a super-smooth ride!


Example Usage

var $window = $(window);

// Disable user scrolling just before animating scrollTop. // Note that the handleScrollbar option must be false if you want to // modify the scroll position whilst it is disabled. $window.disablescroll({ handleScrollbar: false });

$("html, body").animate({ scrollTop: 500 }, "slow", function() {

// Enable user scrolling again when animated scrolling completes



Can be passed on first use:

    option : value

Option | Default Value | Description :---------------- | :----------------------------------------- | :--------------------------------------------------------- handleWheel |

| Boolean indicating whether to disable mouse wheels. handleScrollbar |
| Boolean indicating whether to disable scroll bar dragging. Set to
if you need to modify the scroll position whilst scrolling is disabled. handleKeys |
| Boolean indicating whether to disable scrolling triggered by keypresses, e.g. the down button. scrollEventKeys |
[32, 33, 34, 35, 36, 37, 38, 39, 40]
| Array of scroll-related keycodes to disable during scroll. See below for reference.

Keycode Reference

The following scroll-related keys are all included by default:


32 Spacebar
33 Page Up
34 Page Down
35 End
36 Home
37 Left Arrow
38 Up Arrow
39 Right Arrow
40 Down Arrow

Non-jQuery Usage

If you want to toy around with the object and its prototype, you can access it at


Non-jQuery Angular port available at


Tested in: - Mac: Chrome 38 - Mac: Firefox 33.1 - Mac: Safari 7.1 - Windows: IE 7-11 - Windows: Chrome 38 - Windows: Firefox 33.1 - Android: Chrome 38 - iOS 7.1 and 8.1: Safari

Known Issues

  • Mac Safari 7.1 is a bit flickery when dragging a disabled scrollbar.
  • One report of IE flickering when dragging a disabled scrollbar, although I was unable to reproduce this.
  • Not sure if there is a workaround for these flickering issues, as scrolling by dragging the scrollbar does not trigger any cancellable events. This only leaves us with the option of setting the scroll position back to what it was before on every scroll event. I'm surprised this doesn't flicker in more browsers.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.