javascript 在phonegap android应用程序中加载下一页时显示加载器图像
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19158247/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
To display loader image while loading the next page in phonegap android application
提问by UjjawalKr
I am developing a phonegap android application which consists of three html pages.Each page have some dynamic data that loads on page initialization. I want to display a loader image on the click of a button to navigate to other html page while loading it.
我正在开发一个由三个 html 页面组成的 phonegap android 应用程序。每个页面都有一些在页面初始化时加载的动态数据。我想在加载时单击按钮显示加载器图像以导航到其他 html 页面。
How can i implement this? Is there any default function for this ?
我该如何实施?是否有任何默认功能?
回答by Dom
回答by Suhas
Above answer is also good there is another option manually you have to create one div on each HTML page like
上面的答案也很好,还有另一种手动选择,您必须在每个 HTML 页面上创建一个 div,例如
<div id="pageLoader">
<div>
<img src="images/ajax-loader.gif" /> // give here path of any loader image you want
</div>
</div>
then call $("#pageLoader").show() and $("#pageLoader").hide() wherever you want to show and hide loading.
然后在您想要显示和隐藏加载的任何地方调用 $("#pageLoader").show() 和 $("#pageLoader").hide()。
回答by Ashisha Nautiyal
for android use
供安卓使用
navigator.notification.activityStart
for detail check this
详细检查这个