Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 24th, 2012  |  syntax: None  |  size: 0.64 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <!doctype html>
  2. <html>
  3. <head>
  4.   <meta charset="utf-8">
  5.  
  6.   <title>addTap</title>
  7.  
  8.    <meta name="viewport" content="width=device-width">
  9.  
  10.   <style>
  11.     body {
  12.       font-family: sans-serif;
  13.     }
  14.  
  15.     #box {
  16.       width: 200px;
  17.       height: 300px;
  18.       background: red;
  19.     }
  20.   </style>
  21.  
  22. </head>
  23. <body>
  24.  
  25.   <h1>addTap</h1>
  26.  
  27.  
  28. <div id="box"></div>
  29.  
  30. <script src="addtap.js"></script>
  31. <script>
  32.  
  33. window.onload = function() {
  34.  
  35.   var box = document.getElementById('box');
  36.  
  37.   function onTap( event, cursor ) {
  38.     console.log( 'did tap', event, cursor.pageX, cursor.pageY );
  39.   }
  40.  
  41.   addTap( box, onTap, { moveableBuffer: 20 } );
  42.  
  43. };
  44.  
  45. </script>
  46.  
  47. </body>
  48. </html>