Monday, October 31, 2011

Detect Swipe event in jQuery Mobile

Detect Swipe event in jQuery Mobile

<!DOCTYPE html>
<html>
<head>
<title>jQuery Mobile: Swipe</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/latest/jquery.mobile.css" />
<script src="http://code.jquery.com/jquery.min.js"></script>
<script src="http://code.jquery.com/mobile/latest/jquery.mobile.min.js"></script>
</head>
<body>

<div data-role="page" id="home">
<div data-role="header">
<h1>Swipe</h1>
</div>
<div data-role="content">
<p>Hello ALL</p>
<p>jQuery Mobile: Swipe</p>
<p>Swipe on the screen, Thx!</p>
</div>
<div data-role="footer">
<h4><a href="http://mobile-web-app.blogspot.com/">http://mobile-web-app.blogspot.com/</a></h4>
</div>
</div>
<script>
$('body').bind('swipe', function () {
alert ('You SWIPE on screen!');
return false;
});
</script>
</body>
</html>




No comments:

Post a Comment