• Hi! I'm Lex

  • Web & App designer, UI UX Artist, and Like creative and marketing

iPhone Web App Meta

剛好找到些資訊在此做個紀錄

iPhone 看普通網頁時會將屏幕像素闊度變成 980 像素,如果想將屏幕像素闊度變回原本大小,可以在 head 加入以下設定:
  1. <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1, user-scalable=no" />
  • width=device-width 是用 iPhone 屏幕像素來定義網頁闊度。
  • minimum-scale 是用戶可將畫面縮小的倍率。
  • maximum-scale 是用戶可將畫面放大的倍率。
  • user-scalable 是否給用戶可將畫面放大或縮小。

用戶將網頁收藏為書並加到主畫面時,可以令最下的選單消失,令網頁變為全屏幕,在 head 加入以下設定:
  1. <meta name="apple-mobile-web-app-capable" content="yes" />

用戶將網頁收藏為書並加到主畫面時,可加入自定義的 icon,在 head 加入以下設定:
  1. <link rel="apple-touch-icon" href="/custom_icon.png"/>

用戶將網頁收藏為書並加到主畫面時,可以設定在載入網頁時的等待畫面,在 head 加入以下設定:
  1. <link rel="apple-touch-startup-image" href="/startup.png"/>

用戶將網頁收藏為書並加到主畫面時,可以將最上的狀態列設定為其他顏色(發覺只能設定為黑色),在 head 加入以下設定:
  1. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  • default:灰色
  • black:黑色
  • black-translucent:黑色半透明(不建議使用) 

啟用或關閉瀏覽器自動偵測,如將電話自動轉換為連結

想在網頁載入完成時隱藏最頂的網址列,可加入以下的 Javascript:
  1. window.onload = function(){
  2. setTimeout(function(){
  3. window.scrollTo(0, 1);
  4. }, 100);
  5. }

防止用戶拉動網頁,可加入以下的 Javascript:
  1. document.addEventListener("touchmove", function(event){
  2. event.preventDefault();
  3. }, false);
如果旋轉裝置,則必須在加上 resize event

// jQuery resize event
$(window).resize(function() {
  window.scrollTo(0, 1);
});

4 則留言

匿名 提到...

Hi there it's me, I am also visiting this web site regularly, this web site is really pleasant and the users are genuinely sharing nice thoughts.
Also visit my web site :: fitness gyms

匿名 提到...

May I simply just say what a comfort to discover somebody who truly understands what they're talking about on the net. You definitely realize how to bring an issue to light and make it important. More people must read this and understand this side of your story. I was surprised that you're not more popular because you most certainly have
the gift.
Also see my web page :: best remodeling company in orlando fl

匿名 提到...

Hey this is kinda of off topic but I was wondering if blogs use WYSIWYG
editors or if you have to manually code with HTML.
I'm starting a blog soon but have no coding knowledge so I wanted to get advice from someone with experience. Any help would be greatly appreciated!
My web-site visit the next web page

匿名 提到...

My coder is trying to persuade me to move to .net from PHP.
I have always disliked the idea because of the expenses.
But he's tryiong none the less. I've been using Movable-type on numerous websites for about a year and am concerned about switching to another platform.
I have heard great things about blogengine.
net. Is there a way I can transfer all my wordpress
content into it? Any help would be greatly appreciated!
My website > click the following article

Toggle menu