Jquery Sample Online Template - Page swipe LEFT swipe and right swipe
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).on('swiperight','.table', function()
{
$.mobile.changePage("#page2");
alert("left to right");
});
$(document).on('swipeleft','.table', function()
{
$.mobile.changePage("#page1");
alert("right to left");
});
</script>
<style>
</style>
</head>
<body>
<div data-role="page" id="page1">
<div data-role="header">
<h1>Page 1</h1>
</div><!-- /header -->
<div data-role="content" class="table">
<p >swipe right</p>
</div><!-- /content -->
<div data-role="footer" postion="fixed">
<h4>footer</h4>
</div><!-- /footer -->
</div><!-- /page -->
<div data-role="page" id="page2" class="table">
<div data-role="header">
<h1>Page 2</h1>
</div><!-- /header -->
<div data-role="content">
<p>thanks for swiping, swipe left to go back to page 1</p>
</div><!-- /content -->
<div data-role="footer" postion="fixed">
<h4>Page Footer</h4>
</div><!-- /footer -->
</div><!-- /page -->
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).on('swiperight','.table', function()
{
$.mobile.changePage("#page2");
alert("left to right");
});
$(document).on('swipeleft','.table', function()
{
$.mobile.changePage("#page1");
alert("right to left");
});
</script>
<style>
</style>
</head>
<body>
<div data-role="page" id="page1">
<div data-role="header">
<h1>Page 1</h1>
</div><!-- /header -->
<div data-role="content" class="table">
<p >swipe right</p>
</div><!-- /content -->
<div data-role="footer" postion="fixed">
<h4>footer</h4>
</div><!-- /footer -->
</div><!-- /page -->
<div data-role="page" id="page2" class="table">
<div data-role="header">
<h1>Page 2</h1>
</div><!-- /header -->
<div data-role="content">
<p>thanks for swiping, swipe left to go back to page 1</p>
</div><!-- /content -->
<div data-role="footer" postion="fixed">
<h4>Page Footer</h4>
</div><!-- /footer -->
</div><!-- /page -->
</body>
</html>
No comments:
Post a Comment