Skip to content

Instantly share code, notes, and snippets.

@haojingliu
Forked from pererinha/ignoreMouseWheel.js
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save haojingliu/78511ca49846d4f203c3 to your computer and use it in GitHub Desktop.

Select an option

Save haojingliu/78511ca49846d4f203c3 to your computer and use it in GitHub Desktop.
directive( 'ignoreMouseWheel', function() {
return {
restrict: 'A',
link: function( scope, element ){
element.bind('mousewheel', function () {
element.blur();
} );
}
}
} );
// <input type="number" ignore-mouse-wheel ... >
@haojingliu
Copy link
Author

Remove unused vars

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment