大佬教程收集整理的这篇文章主要介绍了jquery-mobile – 用javascript jquery移动启动画面,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
<link rel="apple-touch-startup-image" href="img/splash.png" />
所以我试图使用它,它可以正常工作,直到它滑入新页面,然后再次像启动屏幕一样处理(例如,当计时器到期时它变为空白 – 在这种情况下为4秒).如何停止/限制此行为,以便changePage仅包含在启动页面中?
<body> <div data-role="page" id="splash"> <div class="splash"> <img src="startup.jpg" alt="startup image" /> <script type='text/javascript'>//<![CDATA[ $(window).load(function(){ $(function() { setTimeout(hideSplash,4000); }); function hideSplash() { $.mobile.changePage("#home","fade"); } });//]]> </script> </div> </div> <div data-role="page" id="home"> <div data-role="header" data-BACkbtn="false"> <h1></h1> </div> <div data-role="content"> </div> </div> </body>
<head> <!-- First include all jquery stuff --> <script src="app.js"></script><!-- external script because we can just include it in every page --> </head> <body> <div data-role="page" id="splash"> <div class="splash"> <img src="startup.jpg" alt="startup image" /> </div> </div> </body>
$(document).on('pageinit','#splash',function(){ // the .on() method does require jQuery 1.7 + but this will allow you to have the contained code only run when the #splash page is initialized. setTimeout(function(){ $.mobile.changePage("home.html","fade"); },4000); });
好的,所以我这样做是因为我们说你有导航菜单,你想把人们送回主页.您不必再次显示启动页面.你可以链接到home.html.分割你的页面有助于保持dom更精简.我希望这有帮助.
以上是大佬教程为你收集整理的jquery-mobile – 用javascript jquery移动启动画面全部内容,希望文章能够帮你解决jquery-mobile – 用javascript jquery移动启动画面所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。