Detect user scroll attempt when overflow is hidden

a 夏天 提交于 2019-12-06 03:44:10

问题


"scroll" does not fire when content is overflow: hidden. "wheel" fires for wheel mouses but not on a magic trackpad or magic mouse. How can I detect the mouse interaction of attempting to scroll in this scenario?


回答1:


You can get the mouse coordinates and other properties like movement easily.

Using that position you can choose when trigger an wheel event or just make the script to scroll the page.

check this fiddle (not mine) to get inspired



来源:https://stackoverflow.com/questions/32512924/detect-user-scroll-attempt-when-overflow-is-hidden

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!