Skip to content

Instantly share code, notes, and snippets.

@elliottmangham
Created December 7, 2020 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elliottmangham/fd172b95824160cee57d7644e044a121 to your computer and use it in GitHub Desktop.
Save elliottmangham/fd172b95824160cee57d7644e044a121 to your computer and use it in GitHub Desktop.
JS / Utilities / Detect mousewheel scroll
$( 'body' ).bind( 'mousewheel', function( e ) {
if ( e.originalEvent.wheelDelta / 120 > 0 ) {
console.log( 'Scrolling up' );
}
else {
console.log( 'Scrolling down' );
}
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment