Catch scrolling event on overflow:hidden element

后端 未结 4 1743
醉话见心
醉话见心 2020-12-01 13:53

Any insights on how to catch a scrolling event on a element that has overflow:hidden? I would like to scroll in a column without showing a scrollbar to the user.

4条回答
  •  伪装坚强ぢ
    2020-12-01 14:39

    $("body").css("overflow", "hidden")
    
    $(document).bind('mousewheel', function(evt) {
        var delta = evt.originalEvent.wheelDelta
        console.log(delta)
    })
    

    works for me. adapted from How do I get the wheelDelta property?

提交回复
热议问题