禁用 Safari 5 的“过度滚动”功能;使用 CSS 或 JavaScript 的行为

发布于 2024-12-26 04:01:12 字数 230 浏览 2 评论 0原文

OS X Lion 上的 Safari 5 允许您滚动越过页面的可见边界,显示其下方的亚麻纹理。这是一个很好的效果,但对于某些网络应用程序 - 特别是那些具有固定位置元素(如侧边栏)的应用程序 - 它可能会分散注意力。有谁知道如何使用 CSS 或 JavaScript 禁用该效果?这一定是可能的,因为苹果自己的 iCloud 等网站已经这样做了。

Safari 5 on OS X Lion allows you to scroll past the visible bounds of the page, revealing a linen texture beneath it. It's a nice effect, but for some web apps – particularly those with fixed-position elements like a sidebar – it can be distracting. Does anyone know how to disable the effect using CSS or JavaScript? It must be possible, because some sites like Apple's own iCloud have done so.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

过度放纵 2025-01-02 04:01:12

有一篇 博客文章 讨论了如何在 Mac OS X 和 iOS 上禁用弹性滚动设备。根据该网站的说法,它似乎与桌面浏览器的以下 CSS 规则一样简单:

body { overflow: hidden; }

There is a blog post that talks about what you need to do to disable elastic scrolling on both Mac OS X and iOS devices. According to the site it appears to be as simple as the following CSS rule for desktop browsers:

body { overflow: hidden; }
不必在意 2025-01-02 04:01:12

这可以解决问题:

body,
html {
  position: fixed;
}

使用 iOS8 和 iOS9 进行测试和验证。

This does the trick:

body,
html {
  position: fixed;
}

Tested and verified with iOS8, and iOS9.

寒尘 2025-01-02 04:01:12
html { overflow: hidden;}
body { overflow: scroll;}
html { overflow: hidden;}
body { overflow: scroll;}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文