Javascript: Overcoming standards mode differences
<p>The problem I am having is with this code:</p>

<pre><code>function scrollLeft() {
    document.body.scrollLeft -= scrollSpeed;
}
</code></pre>

<p>It works perfectly in Chrome and Safari but in IE and Firefox it is doing nothing. I have narrowed this down to the fact that in Firefox and IE standards mode they accept <code>document.documentElement.scrollLeft</code> instead of <code>document.body.scrollLeft</code>and my page is being rendered in standards mode.</p>

<p>Please note that I run this script at an interval of 10ms so I can't afford to have a large clunky detection script running each time this function needs to perform.</p>

<p>Does anyone know a cross browser way or an extremely light way of overcoming this? I am using the jQuery library in this script but Firefox and IE aren't recognising <code>$('body').scrollLeft()</code> either and I'm not sure why that is.</p>
