Javascript Opera - 关闭文档正文滚动(暂时)
我有一个使用鼠标滚轮进行缩放的图片查看器。工作正常,但在 Opera 中除外,滚轮首先滚动页面,然后触发滚轮事件,这不太理想(因为现在图片已在页面上向上或向下移动)。
因此,我想在查看器处于活动状态时关闭正文滚动。应该不会太难吧?
I've got a pic viewer that uses the mouse wheel to zoom. Works fine except in Opera, the wheel scrolls the page first, then fires the wheel event, which is less than desirable (since now the picture has moved up or down the page).
So, I want to turn off the body scroll while the viewer is active. Shouldn't be too hard, right?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
滚动的 JavaScript 是否也调用 event.preventDefault() ?这应该有效,尽管我最近没有亲自测试过。
Does the JavaScript that scrolls also call event.preventDefault()? This should work, though I haven't tested it recently myself.
这可能有用吗?
possibly this might work?