我刚开始学习应用一些触摸手势等等,并决定使用touchswipe。我刚刚开始进行一些测试,并从演示中看到的各种事情开始。但是,到目前为止,我无法使用简单的swipeLeft工作。这是我到目前为止所做的。
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="../../JQuery files/touchswipe.js"></script>
<title>Demo</title>
<style type="text/css">
#swipe {
margin: 0 0 0 0;
padding: 50px;
background: #99FFCC;
}
</style>
</head>
<body>
<div id="swipe">Swipe Here</div>
<script type="text/javascript">var swipeOptions=
{
swipeLeft:swipeLeft,
threshold:0
}
$(function()
{
//Enable swiping...
$("#test").swipe( swipeOptions );
});
//Swipe handlers.
//The only arg passed is the original touch event object
function swipeLeft(event)
{
$("#test").text("wahoo");
}
</script>
</body>
</html>