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
events, instead, I should rewrite a callback function for "onwheel" events.
So what's the difference between onwheel
and onscroll
anyways? I imagine that default onwheel
handler by browsers would automatically trigger onscroll
function to move the scroll bar, which is why preventDefault
in onwheel
's callback will prevent scroll bar moving. Am I right? Who has a better and more specific explanation?