Deplay page loading
Description
The following code shows how to deplay page loading.
Example
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.7.1.js'></script>
<link rel="stylesheet" type="text/css"
href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css">
<script type='text/javascript'
src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
<script type='text/javascript'>//<![CDATA[
$(document).on('click','.customBackBtn',function(){
$.mobile.showPageLoadingMsg();<!--from w ww . j ava 2 s . c o m-->
setTimeout(function(){
$.mobile.hidePageLoadingMsg();
history.back();
}, 1000);
});
//]]>
</script>
</head>
<body>
<div data-role="page" id="page1">
<div data-role="header">
<h1>My Title</h1>
</div>
<!-- /header -->
<div data-role="content">
<p>Hello world</p>
<a href="#page2">link</a>
</div>
<!-- /content -->
</div>
<div data-role="page" id="page2">
<div data-role="header">
<a class="customBackBtn">Back</a>
<h1>My Title</h1>
</div>
<!-- /header -->
<div data-role="content">
<p>Hello world</p>
</div>
<!-- /content -->
</div>
<!-- /page -->
</body>
</html>