问题描述
我想使HTML5应用程序全屏。我做了一个网页,并添加它作为我的iPhone的图标。我加元标签:
I want to make html5 fullscreen app. I made a page and added it as an icon to my iphone. I added metatags:
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="viewport" content="width=device-width, user-scalable=no" />
我想实现的是:在上面的黑色状态栏(?这不工作,我不知道为什么它仍然是默认状态栏...任何人的想法),而可能性(在Facebook应用程序等)进行放大 - 这工作正常
What I wanted to achieve is: black status bar on top (this does not work and I do not know why. It is still default status bar...anyone ideas?) without possibility to zoom (like in facebook app) - this works fine.
现在的问题 - 我可以在我的iPhone滚动,即使我的应用程序在屏幕上适合。它反弹回来,但我不想此行为。我想禁用和启用滚动特定格(的.ui内容)。我怎样才能做到这一点?
Now the problem - I can scroll on my iphone even if my app fits on the screen. It bounces back, but I dont want this behavior. I would like to disable that and enable scrolling for a particular div (.ui-content). How can I achieve that?
编辑:
状态栏现在是黑色的。它一些时间后改变本身。是previous版本的iPhone或缓存什么?
status bar is black now. It changed itself after some time. Was the previous version cached on the iphone or what?
推荐答案
这将prevent滚动整个页面
This will prevent scrolling on the whole page
document.ontouchmove = function(e) {e.preventDefault()};
在你的情况,你想要一些div是滚动的,有的不是,你应该能够赶上事件它获取到文档之前
In your case, where you want some divs to be scrollable, and some not to, you should be able to catch the event before it gets to the document
scrollableDiv.ontouchmove = function(e) {e.stopPropagation()};
这篇关于如何禁用HTML5全屏iPhone应用程序弹跳?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!