title: How do I get the max value of scrollLeft?
body: <p>Okay I'm using jQuery and currently getting max value of scrollbar doing this:</p>
  
  <pre><code>var $body = $('body');
  $body.scrollLeft(99999); // will give me the max value since I've overshot
  var max_value = $body.scrollLeft(); // returns 300
  $('body').scrollLeft(0);
  </code></pre>
  
  <p>When I try this: <code>$body[0].scrollWidth</code> I just get the actual width of the contents - 1580</p>
  
  <p>I'm thinking there has to be a better way I'm forgetting.</p>
  
  <p><strong>EDIT</strong>
  To clarify, I also tried <code>$(window).width()</code> and <code>$(document).width()</code> which gave me 1280 and 1580, respectively.</p>