Handle page before hide event
Description
The following code shows how to handle page before hide event.
Example
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="stylesheet"
href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
<script type="text/javascript"
src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript"
src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
</head><!--from www . ja v a 2 s.com-->
<body>
<div data-role="page" id="home">
<div data-role="content">
<a href="#foo">click me</a>
</div>
</div>
<div data-role="page" id="foo">
<div data-role="content">Next Page Here</div>
</div>
<script>
$("div[data-role='page']").live( "pagebeforehide", function( event ) {
alert('This alert trigger before Next Page Here is shown?');
});
</script>
</body>
</html>