开发者

How to prevent webkit from going back in history when scrolling horizontally?

开发者 https://www.devze.com 2023-04-08 20:25 出处:网络
The title should say it all. Chrome + safari goes back in history when scrolling to the left using a trackpad, very annoying if you expect a horizontal scroll. I was hoping to be able to disable it us

The title should say it all. Chrome + safari goes back in history when scrolling to the left using a trackpad, very annoying if you expect a horizontal scroll. I was hoping to be able to disable it using:

document.addEventListener('mou开发者_JS百科sewheel', function(e) {
    e.preventDefault();
});

But that didn’t work. Neither did a return false; from the handler. I think this is a OSX Lion specific issue, but I’m not sure.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号