Set transition, reloadPage, reverse when changing page
Description
The following code shows how to set transition, reloadPage, reverse when changing page.
Example
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.9.1.js'></script>
<script type="text/javascript"
src="http://code.jquery.com/mobile/1.3.0-beta.1/jquery.mobile-1.3.0-beta.1.js"></script>
<link rel="stylesheet" type="text/css"
href="http://code.jquery.com/mobile/1.3.0-beta.1/jquery.mobile-1.3.0-beta.1.css">
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){<!--from w w w .jav a2 s .c o m-->
$(document).on('pagebeforeshow', function () {
alert('pagebeforeshow is triggered for ' + $.mobile.activePage[0].id);
});
$('.selector').on('click', function (e) {
e.preventDefault();
var page = document.referrer;
$.mobile.changePage(page, {
transition: 'flip',
reloadPage: true,
reverse: true
});
});
});//]]>
</script>
</head>
<body>
<div data-role="page" id="page1">
<a href="#page2" data-role="button">go t o Page2</a>
</div>
<div data-role="page" id="page2">
<a class="selector" href="#" data-role="button">Back to Page1 </a>
</div>
</body>
</html>