Home | History | Annotate | Download | only in touch_ScrollDirection
      1 <!doctype html>
      2 <html lang="en">
      3 <head>
      4 <meta charset="utf-8">
      5 <title>Long Page</title>
      6 <script type="text/javascript">
      7 var startX;
      8 var startY;
      9 var cursorOnPage = false;
     10 var pageReady = false;
     11 var userWidth = screen.width;
     12 var userHeight = screen.height;
     13 
     14 function onLoad() {
     15     document.addEventListener('mousedown', mouseDown);
     16     document.addEventListener('mouseup', mouseUp);
     17     var mainDiv = document.getElementById("longPage")
     18     mainDiv.style.width = parseInt(userWidth * 15) + "px";
     19     mainDiv.style.height = parseInt(userHeight * 15) + "px";
     20     pageReady = true;
     21 }
     22 
     23 function mouseUp(e) {
     24     cursorOnPage = ((e.pageX !=0) || (e.pageY !=0))
     25     clickCount = clickCount + 1;
     26     console.log(clickCount, cursorOnPage)
     27 }
     28 
     29 function mouseDown(e) {
     30     startX = e.pageX;
     31     startY = e.pageY;
     32 }
     33 
     34 </script>
     35 </head>
     36 <body onload="onLoad()">
     37 <div id="longPage"></div>
     38 </body>
     39 </html>
     40