Any way to prevent horizontal scrolling triggering swipe back gesture on OS X Lion Safari?

后端 未结 8 2022
南笙
南笙 2021-01-30 04:09

I am working on a UI that uses horizontal scrolling in a div element (using overflow: scroll). I cannot scroll to the left, because it would start the

8条回答
  •  甜味超标
    2021-01-30 04:38

    I also used jQuery mousewheel, attaching this callback:

    onMousewheel: function(e, delta, deltaX, deltaY){
      e.preventDefault();
      $('leftElement').scrollLeft($('leftElement').scrollLeft() + deltaX); // leftElement =     container element I want to scroll left without going back/forward
      $('downElement').scrollTop($('downElement').scrollTop() - deltaY); // this was another element within the container element
    }
    

提交回复
热议问题