是否可以在使用多点触控滚动时显示狮子中显示的页面背景样式
当使用触摸输入时,Lion 中的 Chrome 和 Safari 具有像 Mobile Safari 一样的过度滚动功能。在大多数网页上,显示的背景是一种灰色羊皮纸图案。尽管如此,有些网站不显示此背景,并且要么具有单一颜色,要么具有第一个像素的背景的重复版本。
堆栈溢出的行为符合预期 堆栈溢出截图
并且mozilla网站如下所示 firefox功能截图
到目前为止,我还无法确定发生这种情况的任何原因。有记录吗?有没有办法复制它?第一个像素的背景要么向上拉伸,要么完全不同。
更进一步。如果可以复制这一点,是否可以使用该效果来重新创建许多移动应用程序中的“拉动刷新”功能?换句话说,这种过度滚动是在 dom 内测量的还是只是操作系统产生的效果?
谢谢
Chrome and Safari in Lion have an overscroll feature like Mobile Safari, when using a touch input. On most web pages the background revealed is a sort of grey parchment pattern. Although, there are some website that don't show this background and either have a single colour or a repeated version of whatever the background of the first pixel.
Stack Overflow behaves as expected
stack overflow screenshot
And the mozilla website is shown below
firefox features screenshot
So far I haven't been able to identify a single reason why this happens. Is it something documented? And is there a method to replicate it? Either with the background of the first pixel stretched upwards or with something completely different.
Going even further with that. If it is possible to replicate this, could the effect be used to recreate the 'pull to refresh' feature found in many mobile applications? In other words, is this overscroll measured within the dom or is it just an effect generated by the OS?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你所说的实际上是所有狮子化应用程序所共有的行为。 Chrome 15(和 16)支持此功能,而 Chrome 14 不支持。这取决于应用程序是否进行了触摸优化。
我认为没有任何方法可以控制这种行为(除非浏览器引入某种“过度滚动”javascript 事件——高度怀疑这种情况会发生)。
也没有已知的方法可以通过 CSS 设置该区域的样式。
What you are talking about is actually a behavior that is common to all lion-ized apps. Chrome 15 (and 16) support this, whereas Chrome 14 doesn't. It's a matter of whether the app has been touch optimized or not.
I don't think there is any way to control this behavior (unless the browser introduces some kind of "overscroll" javascript event -- highly doubt this will happen).
There is also no known way to style this region through CSS.
这在 chrome 15 中有效。position
:fixed、top:0 和 3d 变换操作的组合似乎会导致这种行为。
This works in chrome 15.
The combination of position: fixed, top:0 and a 3d transform operation seem to lead to this behavior.