Any_finger_swipe.html 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
  5. <meta http-equiv="x-ua-compatible" content="IE=9">
  6. <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet">
  7. <link href="http://twitter.github.com/bootstrap/assets/js/google-code-prettify/prettify.css" rel="stylesheet" />
  8. <link href="css/main.css" type="text/css" rel="stylesheet" />
  9. <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
  10. <script type="text/javascript" src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
  11. <script type="text/javascript" src="../jquery.touchSwipe.js"></script>
  12. <script type="text/javascript" src="js/main.js"></script>
  13. <title>touchSwipe</title>
  14. </head>
  15. <body>
  16. <a href="https://github.com/mattbryson"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png" alt="Fork me on GitHub"></a>
  17. <div class="container">
  18. <script id='code_1'>
  19. $(function() {
  20. $("#test").swipe( {
  21. swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
  22. $("#test").text("You swiped " + direction + " with " + fingerCount + " fingers");
  23. },
  24. threshold:0,
  25. fingers:'all'
  26. });
  27. });
  28. </script>
  29. <span class='title'></span>
  30. <h4>Events: <span class='events'><code>swipe</code></span></h4>
  31. <h4>properties: <span class='properties'><code>fingers</code></span></h4>
  32. <p>By setting the number of <code>fingers</code> to 'all', any number of fingers will trigger the swipe.</p>
  33. <button class='btn btn-small btn-info example_btn'>Jump to Example</button>
  34. <pre class="prettyprint" data-src='code_1'></pre>
  35. <span class='navigation'></span>
  36. <div id="test" class="box">Swipe me with different combinations of fingers</div>
  37. <span class='navigation'></span>
  38. </div>
  39. </body>
  40. </html>