OS X Lion Safari 中历史动画的解决方法?

发布于 2024-11-25 11:05:36 字数 420 浏览 3 评论 0原文

在 OS X Lion 的 Safari 中,当您使用滑动手势在历史记录中向前或向后导航时,窗口会呈现动画效果,就像您在物理页面中移动一样。此行为的问题在于,许多应用程序已经侦听历史状态中的更改,并在哈希更改时或使用 HTML5 pushState 时做出适当响应。

一个完美的例子是 GitHub,在进出文件夹时 - https://github.com/johndyer/mediaelement,用于例子。如果您单击某个文件夹,然后滑动到上一页,则会显示结束状态“快照”,然后从开始状态再次动画化,这不仅令人困惑,而且使动画的信息价值无效。

今天是我第一天使用 Lion,但我很好奇是否有其他 Web 开发人员遇到过这个问题,以及您是否找到了解决方法?

In Safari for OS X Lion, when you use the swipe gesture to navigate forward or backward in history, the window animates as though you were moving through physical pages. The problem with this behavior is that many apps already listen for changes in the history state, and respond appropriately -- either when the hash is changed, or when HTML5 pushState is used.

A perfect example is GitHub, when navigating in and out of folders -- https://github.com/johndyer/mediaelement, for example. If you click on a folder, then swipe to the previous page, the end state "snapshot" is shown, and then animated to again from the beginning state, which not only is confusing, but nullifies the informational value of the animation.

Today is my first day using Lion, but I'm curious if any other web devs have encountered this issue, and whether you've found a workaround?

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

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

发布评论

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

评论(3

你在看孤独的风景 2024-12-02 11:05:36

遗憾的是,Safari Developer Library 中似乎没有关于此的文档。

但至少有一个(丑陋的)解决方法可以在您的客户端计算机上禁用它们。
在触控板设置中,如果将在页面之间滑动设置为用两根或三根手指滑动,则可以使用两根手指来制作精美的动画,如果不这样做,则可以使用三根手指
像他们一样。但感觉真的很奇怪,尤其是因为三指滑动是在
方向错误

Sadly it seems there's no documentation about this in the Safari Developer Library.

But there is an (ugly) workaround to disable them on your client machine at least.
In the Trackpad settings, if you set Swipe between pages to Swipe with two or three fingers you can use two fingers to do fancy animations, and three fingers if you don't
like them. But it feels really weird, especially because the three finger swipe is in the
wrong direction.

葬花如无物 2024-12-02 11:05:36

也许使用 Modernizr 嗅探 Safari 并依赖 Safari 的本机动画而不是代码的动画?我知道这对一致性没有帮助,但让我们面对现实......这是我们正在谈论的浏览器!

Maybe use Modernizr to sniff out Safari and rely on Safari's native animation instead of your code's animation? I know this doesn't help with consistency, but lets face it... this is a browser we are talking about!

金橙橙 2024-12-02 11:05:36

我建议您进入设置并导航至手势。在这里,您将看到一个包含选项的小下拉栏。选择其他两个选项之一来解决此问题。希望我能帮忙!

I would suggest that you go into settings and navigate to gestures. Here, you will see a little dropdown bar that contains the options. Select either of the other two options to fix this. Hope I could help!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文