title: Disable horizontal scroll; but allow vertical scroll
body: <p>I'm trying to disable horizontal scroll on a website; <strong>but allowing vertical scrolling.</strong></p>
  <p>I have a script which works like a slider by sliding the 'body' of the page left and revealing more contents. However this creates extra empty space on the right.</p>
  <p>I need to disable horizontal scrolling so users don't see this empty space. I tried the following script but it disables both horizontal and vertical scrolling:</p>
  <pre><code>window.onscroll = function () {
       window.scrollTo(0,0);
  }
  </code></pre>
  <p>I have tried <code>overflow-x: hidden</code> but that doesn't work when the body's width is dynamic and not static.</p>
  <h3>Question:</h3>
  <p>Is there a way to modify the above script to disable the horizontal scrolling and keep vertical scrolling?</p>