When I tried to change the default scroll bar property, I found that it\'s not convenient by rewriting callback function for scroll()
or onscroll
e
onwheel
specifically fires when the mouse wheel is spun. onscroll
fires for any kind of scrolling, including keyboard buttons like the arrow keys, Home, End, Page Up, Page Down, space bar, tabbing etc.
Note that onwheel
is non-standard and should be avoided unless you're specifically targeting browsers that support it and/or are providing an extra feature whose absence won't be felt.