Detect user scroll attempt when overflow is hidden

2019-04-08 15:12发布

问题:

"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