admin管理员组

文章数量:1287581

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.

How can i implement this? Is there any default function for this ?

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.

How can i implement this? Is there any default function for this ?

Share Improve this question edited Oct 3, 2013 at 12:25 Dom 2,5691 gold badge19 silver badges28 bronze badges asked Oct 3, 2013 at 11:39 UjjawalKrUjjawalKr 2411 gold badge4 silver badges20 bronze badges 2
  • Phonegap doesnt handle the navigation between pages. You need to use jQuery mobile or a similar framework. – Sam T Commented Oct 3, 2013 at 11:44
  • i am using jquery mobile bt don't know the way to implement it.Any Help ? – UjjawalKr Commented Oct 3, 2013 at 11:47
Add a ment  | 

3 Answers 3

Reset to default 6

Documentation found here.

function showSpinner(){
    $.mobile.loading("show");
}

function hideSpinner(){
    $.mobile.loading("hide");
}

Above answer is also good there is another option manually you have to create one div on each HTML page like

 <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.

for android use

 navigator.notification.activityStart

for detail check this

show-loading-screen-in-phonegap-app

本文标签: