我使用 skrollr 在网站中实现多个目标(类似视差的背景、更改元素不透明度等),并且它在桌面和移动设备上都运行良好。
我注意到的唯一问题是移动操作系统浏览器不再隐藏工具栏。一旦我禁用 skrollr,一切都很好 - 工具栏在我开始滚动页面后立即消失。当 skrollr 使用时,工具栏始终保持可见。
有没有办法在使用 skrollr 的同时仍保持常规浏览器行为?
如果有任何其他信息可以帮助您理解该问题,请告诉我。
谢谢
最佳答案
我们无法以编程方式隐藏/显示地址栏。甚至不可能只是隐藏它(iOS 7 使这完全不可能,而 7.1 会添加一些元标记来完全隐藏它),更不用说再次显示它了。
https://gist.github.com/scottjehl/1183357
The old hack of using window.scrollTo to hide the URL bar doesn’t work anymore; therefore there is no way to hide the URL bar or toolbar without user’s intervention scrolling the page.
If you are not using a natural scroll, you will have problems (detailed below).
http://www.mobilexweb.com/blog/safari-ios7-html5-problems-apis-review
A property, minimal-ui, has been added for the viewport meta tag key that allows minimizing the top and bottom bars on the iPhone as the page loads. While on a page using minimal-ui, tapping the top bar brings the bars back. Tapping back in the content dismisses them again.
For example, use <meta name="viewport" content="width=1024, minimal-ui">.
关于javascript - Skrollr 不会隐藏 iOS 或 Android 浏览器中的工具栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21181242/