title: Is there a way to set the window's scroll position without using scroll() or scrollTo()?
body: <p>...the reason I ask is that Safari has a bug in its implementation of scroll() that is breaking my UI.</p>
  
  <p>Imagine a page:</p>
  
  <pre><code>&lt;body&gt;
      &lt;div id="huge" style="width: 4000px; height: 4000px;"&gt;&lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>...so that you get both horizontal and vertical scrollbars. Now, normally when you press the scrollbar, the page scrolls (vertically). For the purposes of our fancy UI we don't want that to happen, so we squash the keyDown event:</p>
  
  <pre><code>window.onkeydown = function(e) {
      if(e.keyCode == 32)
      {
          return false;
      }
  };
  </code></pre>
  
  <p>This works great...unless we decide that instead of preventing scrolling altogether, we want our own, custom scrolling behavior:</p>
  
  <pre><code>window.onkeydown = function(e) {
      if(e.keyCode == 32)
      {
          window.scroll(foo, bar); // Causes odd behavior in Safari
          return false;
      }
  };
  </code></pre>
  
  <p>In other browsers (Chrome, Firefox), this will instantaneously move the window's scroll position to the desired coordinates. But in Safari this causes the window to <em>animate</em> to the desired scroll position, similar to the scrolling animation that takes place if you press the space bar.</p>
  
  <p>Note that if you trigger this scroll off of any key OTHER than the space bar, the animation does not take place; the window scrolls instantly as in other browsers.</p>
  
  <p>If you happen to be scrolling, say, 1000 pixels or more, then the animated scroll can induce some serious discomfort.</p>
  
  <p>I'm scratching my head trying to find a way around this. I suspect that there isn't one, but I'm hoping some God of Javascript here can suggest something. I'd really like to be able to use the space bar for this command.</p>