Skip to content

Instantly share code, notes, and snippets.

@allieus
Created August 29, 2011 07:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allieus/1177949 to your computer and use it in GitHub Desktop.
Save allieus/1177949 to your computer and use it in GitHub Desktop.
jQueryMobile pagebeforeshow test
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>jQueryMobile Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.min.css" />
<script src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.min.js"></script>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
$(function() {
$("#home").live("pagebeforeshow", function() {
$(this).find("a.go_detail").click(function() {
var seq = $(this).attr("data-seq");
alert(seq);
return true;
});
});
});
</script>
</head>
<body>
<div data-role="page" id="home">
<div data-role="header">
<h1>Home</h1>
</div>
<div data-role="content">
<ul>
<li><a href="#view" class="go_detail" data-seq="10" >View 10</a></li>
<li><a href="#view" class="go_detail" data-seq="20" >View 20</a></li>
<li><a href="#view" class="go_detail" data-seq="30" >View 30</a></li>
<li><a href="#view" class="go_detail" data-seq="40" >View 40</a></li>
<li><a href="#view" class="go_detail" data-seq="50" >View 50</a></li>
</ul>
</div>
</div>
<div data-role="page" id="view">
<div data-role="header">
<h1>Map</h1>
</div>
<div data-role="content">
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment