滚轮事件:
滚屏事件:
onscroll
onmousewheel IE | Chrome
通过 ev.wheelDelta 能够知道当前滚轮的方向:
上滚 是正数
下滚 是负数
DOMMouseScroll FF用的,必须用 addEventListener 来绑定
通过 ev.detail 能够知道当前滚轮的方向:
上滚 是负数
下滚 是正数
例子:
单页切换效果,等更多例子看2018年11月19号的课件