私はjqueryモバイルアプリに取り組んでいます。ここでは、iPod、iPhone、Androidモバイル、Webブラウザーを含むすべてのデバイスのスプラッシュ画面を表示したいと考えています。
私は以下のコードを試しました:
1.)
<script type="text/javascript">
(function () {
var a; if (navigator.platform === "iPad") {
a = window.orientation === 90 || window.orientation === -90 ?
"_Startup_748x1024.png" : "Startup_768x1004.png"
} else {
a = window.devicePixelRatio === 2 ?
"Startup_640x920.png" : "Startup_320x460.png"
}
document.write('<link rel="apple-touch-startup-image" href="' + a + '"/>') })()
上記のコードは、AndroidモバイルおよびWebブラウザでは機能しません。
2.)
<div data-role="page" id="splash">
@Html.Partial("_MobileHeader")
<div class="splash">
<img src="images/_Startup_748x1024.png" alt="startup image" style="width: 100%; height: 100%" />
</div>
<div data-role="content" id="pagecontent" data-theme="c">
@RenderBody()
</div>
<!--End content div -->
@Html.Partial("_MobileFooter")
</div>
and the script that i have used is :
$(document).on('pageinit','#splash',function(){
setTimeout(function(){
$.mobile.changePage("#pagecontent", "fade");
}, 4000); });
上記のコードでは、両方のdivが一緒に表示されます。最初にスプラッシュ画面のみを表示し、次に別のdivのコンテンツを表示したいと思います。
上記の問題の可能な解決策を教えてください。助けていただければ幸いです。
前もって感謝します。