1 <!doctype html> 2 <html lang="en"> 3 <head> 4 <meta charset="utf-8"> 5 <title>Tap Settings Page</title> 6 <script> 7 var pageReady = false; 8 var startX; 9 var startY; 10 var movementOccurred = false; 11 var clickCount = 0; 12 13 function onLoad() { 14 document.addEventListener('mousedown', mouseDown, false); 15 document.addEventListener('mouseup', mouseUp, false); 16 pageReady = true; 17 } 18 19 function mouseUp(e) { 20 var deltaX = e.pageX - startX; 21 var deltaY = e.pageY - startY; 22 movementOccurred = ((deltaX != 0) || (deltaY != 0)); 23 clickCount = clickCount + 1; 24 console.log(movementOccurred, deltaX, deltaY, clickCount) 25 } 26 27 function mouseDown(e) { 28 startX = e.pageX; 29 startY = e.pageY; 30 } 31 </script> 32 </head> 33 <body onload="onLoad()"> 34 </body> 35 </html> 36