SHARE
TWEET

Untitled

a guest Jun 16th, 2019 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <body style="touch-action: none; overflow: hidden; overscroll-behavior-y: contain; position: fixed;" oncontextmenu="return false">
  2.     <noscript>You need to enable JavaScript to run this app.</noscript>
  3.      <script>
  4.     function preventPullToRefresh(element) {
  5.         var prevent = false;
  6.         document.querySelector(element).addEventListener('touchstart', function(e){
  7.         if (e.touches.length !== 1) { return; }
  8.         var scrollY = window.pageYOffset  document.body.scrollTop  document.documentElement.scrollTop;
  9.         prevent = (scrollY === 0);
  10.         });
  11.         document.querySelector(element).addEventListener('touchmove', function(e){
  12.         if (prevent) {
  13.             prevent = false;
  14.             e.preventDefault();
  15.         }
  16.         });
  17.     }
  18.     preventPullToRefresh('#root') // pass #id or html tag into the method
  19.   </script>
  20.   </body>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top