1

我刚刚开始学习应用一些触摸手势等,并决定使用 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>
4

0 回答 0