How to prevent a browser from going back/forward in history when scrolling horizontally?

前端 未结 5 1899
长发绾君心
长发绾君心 2020-12-09 17:39

How can one disable a modern browsers default functionality using JQuery or Native JS for going backwards or forwards when scrolling horizontally?

This usually happe

5条回答
  •  醉酒成梦
    2020-12-09 18:09

    If you're on a mac this is caused by the Track Pad Gestures.

    System Preferences -> Trackpad -> More Gestures. 
    

    Not the JS solution you're looking for, but if you just want to prevent it for yourself you can turn the feature off.

提交回复
热议问题