Reputation: 747
I've been experimenting with jQuery Mobile. I am trying to implement the following
I would like to display the jquery mobile loading popup until the page is ready and then continue.
In the jQueryMobile Docs and Demos under 'list views' and 'list performance tests' this performs as how i would like mine to.
I've tried binding to the 'pagebeforeshow' event but to no avail.
Any help would be greatly appreciated.
Upvotes: 3
Views: 4654
Reputation: 1
I also encountered same issue while loading pages. I used below code to eliminate
$(document).on("pagebeforeshow","#page",function(){
$("#header").empty();
$("#content").empty();
$("#footer").empty();
});
$(document).on("pageshow","#page",function()
{
$("#header").append("<h2 align='center'>"+'Header'+"</h2>");
$("#content").append("<h2 align='center'>"+'Content'+"</h2>");
$("#footer").append("<h2 align='center'>"+'Footer'+"</h2>");
});
Upvotes: 0
Reputation: 2503
try to put a click handler on the GUI item that you mentioned - the navbar.
in that function make the ajax call, and in the success function of the ajax call once you have setup your item show the next page.
To show the load spinning wheel use:
$.mobile.showPageLoadingMsg();
You move to the next page using:
$.mobile.changePage
Upvotes: 0
Reputation: 809
use this functions to hide and show loader and your own in java script
//show loader
var showLoader = function () {
$('.ui-loader').css('display', 'block');
}
//hide loader
var hideLoader = function () {
$('.ui-loader').css('display', 'none');
}
Upvotes: 3