如何使用jquerymobile在Web应用程序中添加全屏欢迎图像

问题描述:

我认为它在jQTouch中有,但是如何为使用jQueryMobile开发的iPhone Web应用程序添加全屏欢迎图像?如何使用jquerymobile在Web应用程序中添加全屏欢迎图像

该应用程序是一个全屏网络应用程序,它已经添加到iPhone的主屏幕。

这仅仅是一个概念,但你可以尝试这样的事:

活生生的例子:http://jsfiddle.net/yzvWy/14/

JS

$(function() { 
    setTimeout(hideSplash, 2000); 
}); 

function hideSplash() { 
    $.mobile.changePage("#home", "fade"); 
} 

HTML

<div data-role="page" data-theme="b" id="splash" style="background-color: #fff;"> 
    <div class="splash"> 
     <img src="http://jquerymobile.com/demos/1.0a4.1/docs/_assets/images/jquery-logo.png" alt="splash" /> 
    </div> 
</div> 
<div data-role="page" data-theme="b" id="home"> 
    <div data-role="content"> 
     <div data-role="content"> 
      <ul data-role="listview" data-inset="true" data-theme="c" data-dividertheme="b"> 
       <li data-role="list-divider">Overview</li> 
       <li><a href="docs/about/intro.html">Intro to jQuery Mobile</a></li> 
       <li><a href="docs/about/features.html">Features</a></li> 
       <li><a href="docs/about/accessibility.html">Accessibility</a></li> 
       <li><a href="docs/about/platforms.html">Supported platforms</a></li> 
      </ul> 
     </div> 
    </div> 
</div> 

的iOS有propertiary东西用于在应用程序加载时显示飞溅。我没有使用它,但(我也没必要说),但在这里,他们是怎么说这是可以做到:

<link rel="apple-touch-startup-image" href="img/splash.png" /> 

你可能也想这样:

<link rel="apple-touch-icon" href="./apple-touch-icon.png" /> 

在这里看到更多: http://matt.might.net/articles/how-to-native-iphone-ipad-apps-in-javascript/

+0

内容丰富,谢谢+1 – 2011-06-14 12:48:55

感谢您的帮助。这并不适用于当前Jquery Mobile的稳定版本,因为它还不支持1.7。我设法结合这个问题的另一个解决方案,并提出:

$ (function(){ 
setTimeout(function(){ 
    $.mobile.changePage("#home", "fade"); 
}, 3000); 
}); 

谢谢!