Change page with pop effect
Description
The following code shows how to change page with pop effect.
Example
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.5.2.js'></script>
<link rel="stylesheet" type="text/css"
href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css">
<script type='text/javascript'
src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>
<script type='text/javascript'>
$(window).load(function(){<!--from ww w.j a v a 2s. co m-->
$('#submit-button-1').click(function() {
$.mobile.changePage($('#page2'), 'pop', false, true);
});
$('#submit-button-2').click(function() {
console.log('Going back to Page 1');
$.mobile.changePage($('#page1'), 'pop', false, true);
});
});
</script>
</head>
<body>
<div data-role="page" data-theme="c" id="page1">
<div data-role="content">
<p>This is Page 1</p>
<button type="submit" data-theme="a" name="submit"
value="submit-value" id="submit-button-1">Open Dialog</button>
</div>
</div>
<div data-role="page" data-theme="a" id="page2">
<div data-role="content">
<p>This is Page 2</p>
<button type="submit" data-theme="e" name="submit"
value="submit-value" id="submit-button-2">Close Dialog</button>
</div>
</div>
</body>
</html>