html5 apps,HTML5 Full Screen Web Apps: No browser bars

问题

I am creating a HTML5 web app for mobile devices and was asked to hide the browser nav bar (the back & forward buttons) (typo here prev.). How can I achieve that?

I think I should be able to achieve that using Phone Gap. But I wonder if its possible for a "normal" web app to hide the browser bar? I think its possible if I pin the web site/app to the home screen?

iPhone has http://ajaxian.com/archives/iphone-full-screen-webapps, but what about Andriod at least?

回答1:

I know this question is a bit out of date at this point so here is an update:

On Safari for iOS 7+ this solution is great:

The minimal-ui attribute makes the browser hide all the buttons while keeping the taskbar intact.

I have not tested this for android.

回答2:

If you can use JQuery in your web-app than I would suggest you to go for NiceScroll plugin.

It can be used for both mobile and desktop browsers and will hide the browser's scrollbars. If your code is going beyond the viewport height of browser than it will make a custom scrollbar which will fadeout if not in use.

Here is its Demo.

Edit:

As per your update, I would like to add that I am actually not a native mobile web-app developer but while searching for your problems I found some SO questions that can help you to lead the way further:

Removing address bar from browser (to view on Android)

Fullscreen Web App for Android

And these tutorials:

Full Screen Web Apps

Best Practices for Web Apps

回答3:

You could use this application for Android: Kiosk Web/Html Browser, it creates a folder in your sd card where you can put the html, showed in fullscreen "immersive mode".

回答4:

var el = document.body;

// Supports most browsers and their versions.

var requestMethod = el.requestFullScreen || el.webkitRequestFullScreen

|| el.mozRequestFullScreen || el.msRequestFullScreen;

if (requestMethod) {

// Native full screen.

requestMethod.call(el);

} else if (typeof window.ActiveXObject !== "undefined") {

// Older IE.

var wscript = new ActiveXObject("WScript.Shell");

if (wscript !== null) {

wscript.SendKeys("{F11}");

}

}

}

click

回答5:

There's such function in the latest Chrome for Android beta:

https://developers.google.com/chrome/mobile/docs/installtohomescreen

回答6:

EDIT

New answer

Much has change since this question was asked. There now is good native support for scrolling, fixed position, and the browser bar of most OS is a lot smaller then back then. Since this is the case I would advice not to resort to scrolling hacks as most sites and answers recommend. Sticking to the rules of the OS will improve the stability, usability and future compatibility of your webapp.

Old answer

It's possible for iPhone when somebody saves it as a webapp to the homescreen. This works if you add the proper meta tags.

For the standard browsermode it's a bit trickier you have to fallback to hacks. Basically the address bar disappears when you scroll (for Iphone and most of the times for android). You can fake this with javascript. Mobile tuts also has a good article on it:

http://mobile.tutsplus.com/tutorials/mobile-web-apps/remove-address-bar/, but this only works when content is longer the screen resolution.

来源:https://stackoverflow.com/questions/11280826/html5-full-screen-web-apps-no-browser-bars

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值