I tried swipe from jquerymobile in HTML and Javascript, it is working fine. As below
<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.css" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.js"></script>
<script>
$(document).ready(function(){
$("#home").swipeleft(function(){
$.mobile.changePage("#page1");
});
});
</script>
</head>
<body>
<div data-role="page" id="home">
<div data-role="content">
<p>
<ul data-role="listview" data-inset="true" data-theme="c">
<li id="listitem">Swipe Right to view Page 1</li>
</ul>
</p>
</div>
</div>
<div data-role="page" id="page1">
<div data-role="content">
<ul data-role="listview" data-inset="true" data-theme="c">
<li data-role="list-divider">Navigation</li>
<li><a href="#home">Back to the Home Page</a></li>
</ul>
<p>
Yeah!<br />You Swiped Right to view Page 1
</p>
</div>
</div>
</body>
</html>
But I tried the same thing in VisualForce, it does not work. As below:
<apex:page docType="html-5.0" standardStylesheets="false" showHeader="false" cache="true" controller="InstallerController">
<html>
<head>
<link rel="stylesheet" href="{!$Resource.jqueryMobileCSS}" />
<apex:includeScript value="{!$Resource.jqueryJS}"/>
<apex:includeScript value="{!$Resource.jqueryMobileJS}"/>
<apex:includeScript value="{!$Resource.installer}"/>
<script>
$(document).ready(function(){
$("#mainpage").swipeleft(function(){
$.mobile.changePage("#page1");
});
});
</script>
<meta http-equiv="Content-Type" context="text/html;charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no; "/>
</head>
<body>
<div data-role="page" data-theme="b" id="mainpage" >
<div data-role="header">
<a href="#mainpage" id="home" class="ui-btn-left" data-icon="home">Home</a>
<h1>Activities</h1>
<a href="#" id="delete" class="ui-btn-right" data-icon="delete"></a>
<!--<a href="#" id="back" class="ui-btn-right" data-icon="back"></a>-->
</div>
<div data-role="content">
<ul id="activitylist" data-role="listview" data-inset="true" data-theme="c" data-dividertheme="b">
</ul>
</div>
</div>
<div data-role="page" data-theme="b" id="page1" >
<div data-role="header">
<a href="#mainpage" id="home" class="ui-btn-left" data-icon="home">Home</a>
<h1>Customer Profile</h1>
</div>
<div data-role="content">
<h1>new page</h1>
</div>
</div>
</body>
</html>
</apex:page>
I used same version of CSS,JS. It just does not work. I do not know if it is VisualForce's problem or my code's problem?