how to add full screen welcome image on a web app using jquerymobile

孤人 提交于 2019-12-31 08:39:51

问题


I think it's there in jQTouch but how do I add a full screen welcome image for my iPhone web app developed using jQueryMobile?

The app is a full screen web app and it is already added in the iPhone Homescreen.


回答1:


This is just a concept but you could try something like this:

Live Example: 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>



回答2:


iOS has its propertiary stuff for displaying a splash while app loads. I didn't use it yet (I didn't need that) but here's how they say it can be done:

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

You might want this too:

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

See here for more: http://matt.might.net/articles/how-to-native-iphone-ipad-apps-in-javascript/




回答3:


Thanks for the help. This didn't work with the current stable release of Jquery Mobile, since it doesn't yet support 1.7. I managed to combine it another solution on the matter and came up with:

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

Thanks!



来源:https://stackoverflow.com/questions/6332989/how-to-add-full-screen-welcome-image-on-a-web-app-using-jquerymobile

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!