What's the difference between “onwheel” and “onscroll” events?

前端 未结 4 2032
不知归路
不知归路 2020-12-20 13:09

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

4条回答
  •  攒了一身酷
    2020-12-20 13:57

    onwheel: Occurs when the mouse wheel is rolled up or down over an element.

    onscroll Occurs when an element's scrollbar is being scrolled.

    It's important to note that in Internet Explorer, the wheel event is only supported through addEventListener. You can't use the onwheel event attribute.

    onwheel doesn't work in Safari or in IE8 or earlier.

提交回复
热议问题