有没有办法区分页面是基于鼠标滚轮滚动还是拖动滚动条?我需要对两者采取不同的行动。
答案 0 :(得分:0)
使用mousewheel
事件,该事件将在使用鼠标滚轮从here滚动页面时触发。
答案 1 :(得分:0)
看起来有一些现有的插件可以处理鼠标滚轮事件:
https://github.com/brandonaaron/jquery-mousewheel
这些事件采用现有的onmousewheel
事件并使它们跨浏览器,但我认为最近版本的jQuery可能已经使用mousewheel
事件执行此操作:
$('#myselector').bind('mousewheel', function() { } );