| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html style="width: 100%; height: 100%"> |
| 3 <head> |
| 4 <script> |
| 5 function touchHandler(e, type) { |
| 6 var touchResult = document.getElementById("last-touch-event"); |
| 7 touchResult.innerHTML = type; |
| 8 } |
| 9 |
| 10 function getLastTouchEvent() { |
| 11 var touchResult = document.getElementById("last-touch-event"); |
| 12 return touchResult.innerHTML; |
| 13 } |
| 14 |
| 15 window.addEventListener('load', function(){ // on page load |
| 16 document.body.addEventListener('touchstart', |
| 17 function(e){ |
| 18 touchHandler(e, "touchstart"); |
| 19 }, false); |
| 20 |
| 21 document.body.addEventListener('touchmove', |
| 22 function(e){ |
| 23 touchHandler(e, "touchmove"); |
| 24 }, false); |
| 25 |
| 26 document.body.addEventListener('touchend', |
| 27 function(e){ |
| 28 touchHandler(e, "touchend"); |
| 29 }, false); |
| 30 }, false); |
| 31 </script> |
| 32 </head> |
| 33 |
| 34 <!-- Be sure to set 100% width/height so the test can determine an appropriate |
| 35 screen region for targeting events. --> |
| 36 <body style="width: 100%; height: 100%"> |
| 37 Page with Touch Handler |
| 38 <div id="last-touch-event">noevent</div> |
| 39 </body> |
| 40 </html> |
| OLD | NEW |