服務(wù)熱線
153 8323 9821
移動(dòng)終端瀏覽器默認(rèn)設(shè)置視口的寬度和初始規(guī)模。
最近做的一個(gè)移動(dòng)終端的項(xiàng)目,遇到一個(gè)默認(rèn)設(shè)置更改的問(wèn)題。起初非常懷疑是自己的html寫的有問(wèn)題。經(jīng)過(guò)一番頁(yè)面尺寸的測(cè)試之后終于找到問(wèn)題根源。知道是什么問(wèn)題就可以找解決的方法了。
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,height=device-height"/>
<meta name="format-detection" content="telephone=no">
在頁(yè)面的頭部文件中加入了以上設(shè)定就ok了。以下是找到的有關(guān)于這些設(shè)定的解析。記錄下來(lái)避免忘記。
然而這些設(shè)定只在移動(dòng)終端的瀏覽器中有效,非移動(dòng)終端瀏覽器這些設(shè)定是無(wú)效的。并且要這些瀏覽器是基于iPhone而來(lái)的。初次涉及移動(dòng)終端的應(yīng)用,惱人的事情不只這一件呢,呵呵O(∩_∩)O~
Sets whether a web application runs in full-screen mode.
<meta name="apple-mobile-web-app-capable" content="yes"> |
If content yes, the web application runs in full-screen mode; otherwise, it does not. The default behavior is to use Safari to display web content.
You can determine whether a webpage is displayed in full-screen mode using the window.navigator.standalone
Available in iPhone OS 2.1 and later.
Apple extension.
Sets the style of the status bar for a web application.
<meta name="apple-mobile-web-app-status-bar-style" content="black"> |
下一篇:移動(dòng)控件的自定義屬性