Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.42 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Events Example</title>
  5. <meta name="viewport" content="width=device-width,user-scalable=no">
  6. <style type="text/css">
  7. html, body {
  8. -webkit-tap-highlight-color:transparent;
  9. -moz-tap-highlight-color:transparent;
  10. -ms-tap-highlight-color:transparent;
  11. -o-tap-highlight-color:transparent;
  12. tap-highlight-color:transparent;
  13. }
  14. button {
  15. -webkit-appearance:none;
  16. display:block;
  17. margin:0 auto;
  18. padding:5px 10px;
  19. font-family:Helvetica, Arial, sans-serif;
  20. font-size:18px;
  21. line-height:30px;
  22. font-weight:bold;
  23. width:200px;
  24. cursor:pointer;
  25.  
  26. border:none;
  27. background-color:#ff7800;
  28. color:#fff;
  29. outline:none;
  30. }
  31.  
  32. button:active {
  33. background-color:#cd6101;
  34. }
  35. </style>
  36. </head>
  37. <body ontouchmove="">
  38. <h1>Scroll down to the button and click it</h1>
  39. <p>We will be sure to post a comment. Add tomato sauce, no tank or a traditional or online. Until outdoor environment, and not just any competition, reduce overall pain. Cisco Security, they set up in the throat develop the market beds of Cura; Employment silently churn-class by our union, very beginner himenaeos. Monday gate information. How long before any meaningful development. Until mandatory functional requirements to developers. But across the country in the spotlight in the notebook. The show was shot. Funny lion always feasible, innovative policies hatred assured. Information that is no corporate Japan.</p>
  40. <p>We will be sure to post a comment. Add tomato sauce, no tank or a traditional or online. Until outdoor environment, and not just any competition, reduce overall pain. Cisco Security, they set up in the throat develop the market beds of Cura; Employment silently churn-class by our union, very beginner himenaeos. Monday gate information. How long before any meaningful development. Until mandatory functional requirements to developers. But across the country in the spotlight in the notebook. The show was shot. Funny lion always feasible, innovative policies hatred assured. Information that is no corporate Japan.</p>
  41. <p>We will be sure to post a comment. Add tomato sauce, no tank or a traditional or online. Until outdoor environment, and not just any competition, reduce overall pain. Cisco Security, they set up in the throat develop the market beds of Cura; Employment silently churn-class by our union, very beginner himenaeos. Monday gate information. How long before any meaningful development. Until mandatory functional requirements to developers. But across the country in the spotlight in the notebook. The show was shot. Funny lion always feasible, innovative policies hatred assured. Information that is no corporate Japan.</p>
  42. <p>We will be sure to post a comment. Add tomato sauce, no tank or a traditional or online. Until outdoor environment, and not just any competition, reduce overall pain. Cisco Security, they set up in the throat develop the market beds of Cura; Employment silently churn-class by our union, very beginner himenaeos. Monday gate information. How long before any meaningful development. Until mandatory functional requirements to developers. But across the country in the spotlight in the notebook. The show was shot. Funny lion always feasible, innovative policies hatred assured. Information that is no corporate Japan.</p>
  43. <p>We will be sure to post a comment. Add tomato sauce, no tank or a traditional or online. Until outdoor environment, and not just any competition, reduce overall pain. Cisco Security, they set up in the throat develop the market beds of Cura; Employment silently churn-class by our union, very beginner himenaeos. Monday gate information. How long before any meaningful development. Until mandatory functional requirements to developers. But across the country in the spotlight in the notebook. The show was shot. Funny lion always feasible, innovative policies hatred assured. Information that is no corporate Japan.</p>
  44. <p>We will be sure to post a comment. Add tomato sauce, no tank or a traditional or online. Until outdoor environment, and not just any competition, reduce overall pain. Cisco Security, they set up in the throat develop the market beds of Cura; Employment silently churn-class by our union, very beginner himenaeos. Monday gate information. How long before any meaningful development. Until mandatory functional requirements to developers. But across the country in the spotlight in the notebook. The show was shot. Funny lion always feasible, innovative policies hatred assured. Information that is no corporate Japan.</p>
  45. <button id="click">Click Me</button>
  46. <p>We will be sure to post a comment. Add tomato sauce, no tank or a traditional or online. Until outdoor environment, and not just any competition, reduce overall pain. Cisco Security, they set up in the throat develop the market beds of Cura; Employment silently churn-class by our union, very beginner himenaeos. Monday gate information. How long before any meaningful development. Until mandatory functional requirements to developers. But across the country in the spotlight in the notebook. The show was shot. Funny lion always feasible, innovative policies hatred assured. Information that is no corporate Japan.</p>
  47. <p>We will be sure to post a comment. Add tomato sauce, no tank or a traditional or online. Until outdoor environment, and not just any competition, reduce overall pain. Cisco Security, they set up in the throat develop the market beds of Cura; Employment silently churn-class by our union, very beginner himenaeos. Monday gate information. How long before any meaningful development. Until mandatory functional requirements to developers. But across the country in the spotlight in the notebook. The show was shot. Funny lion always feasible, innovative policies hatred assured. Information that is no corporate Japan.</p>
  48. <p>We will be sure to post a comment. Add tomato sauce, no tank or a traditional or online. Until outdoor environment, and not just any competition, reduce overall pain. Cisco Security, they set up in the throat develop the market beds of Cura; Employment silently churn-class by our union, very beginner himenaeos. Monday gate information. How long before any meaningful development. Until mandatory functional requirements to developers. But across the country in the spotlight in the notebook. The show was shot. Funny lion always feasible, innovative policies hatred assured. Information that is no corporate Japan.</p>
  49. <script type="text/javascript">
  50. (function(){
  51. var _handleClick = function(){
  52. console.log('Cursor clicked, firing callbacks');
  53. for (var i = 0, len = this._fastClickCallbacks.length; i < len; i++) {
  54. this._fastClickCallbacks[i].call(this);
  55. }
  56. },
  57. _handleTouchMove = function(){
  58. this._fastClickCallbacks.moved = true;
  59. },
  60. _handleTouchEnd = function(event){
  61. if (this._fastClickCallbacks.moved) {
  62. // Finger moved, so don't fire the click
  63. this._fastClickCallbacks.moved = false;
  64. return;
  65. } else {
  66. // Prevents the click event from firing
  67. event.preventDefault();
  68. }
  69.  
  70. console.log('Touch end, firing callbacks');
  71. for (var i = 0, len = this._fastClickCallbacks.length; i < len; i++) {
  72. this._fastClickCallbacks[i].call(this);
  73. }
  74. };
  75.  
  76. HTMLElement.prototype.addFastClick = function(callback){
  77. if (!this._fastClickCallbacks) {
  78. this._fastClickCallbacks = [];
  79. this.addEventListener('click', _handleClick, false);
  80. this.addEventListener('touchmove', _handleTouchMove, false);
  81. this.addEventListener('touchend', _handleTouchEnd, false);
  82. }
  83.  
  84. this._fastClickCallbacks.push(callback);
  85. };
  86.  
  87. HTMLElement.prototype.removeFastClick = function(callback){
  88. var index;
  89.  
  90. if (!this._fastClickCallbacks) {
  91. return;
  92. }
  93.  
  94. index = this._fastClickCallbacks.indexOf(callback);
  95. if (index >= 0) {
  96. this._fastClickCallbacks.splice(index, 1);
  97. }
  98.  
  99. if (!this._fastClickCallbacks.length) {
  100. this.removeEventListener('click', _handleClick, false);
  101. this.removeEventListener('touchmove', _handleTouchMove, false);
  102. this.removeEventListener('touchend', _handleTouchEnd, false);
  103. this._fastClickCallbacks = undefined;
  104. }
  105. };
  106.  
  107. var el = document.getElementById('click'),
  108. reset = function(){
  109. el.innerHTML = 'Click Me';
  110. },
  111. _timer;
  112.  
  113. el.addFastClick(function(){
  114. this.innerHTML = 'Clicked!';
  115. clearTimeout(_timer);
  116. _timer = setTimeout(reset, 1000);
  117. });
  118. })()
  119. </script>
  120. </body>
  121. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement