title: How to disable scroll on mobile browser without checking device?
body: <p>Interesting question:</p>
  
  <p>How to disable scroll on mobile device BUT in code no need to check mobile browser o etc.</p>
  
  <p>I'm writing mobile version of web site. In web browser my function works well!</p>
  
  <p>When i calling Scroll("off); it's stops. But on mobile device (ios) i still can touchmoving content. </p>
  
  <p>Can someone help to modify function for this case? Result must be: No scroll on web, NO touching moves on mobile device.</p>
  
  <p>Here what i have:</p>
  
  <pre><code>function Scroll(str)
      {
        var scrollPosition = [
          self.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft,
          self.pageYOffset || document.documentElement.scrollTop  || document.body.scrollTop
        ];
  
        if(str=="off")
        {
          var html = jQuery("html");
          html.data("scroll-position", scrollPosition);
          html.data("previous-overflow", html.css("overflow"));
          html.css("overflow", "hidden");
          window.scrollTo(scrollPosition[0], scrollPosition[1]);
        }
        else
        {
          var html = jQuery("html");
          var scrollPosition = html.data("scroll-position");
          html.css("overflow", html.data("previous-overflow"));
          window.scrollTo(scrollPosition[0], scrollPosition[1]);
        }
      }
  </code></pre>