Okay I\'m using jQuery and currently getting max value of scrollbar doing this:
var $body = $(\'body\');
$body.scrollLeft(99999); // will give me the max val
AFAIK you have to calculate the maximum scroll value yourself, it is the difference between the parent/container's width and the child/content width.
An example on how to do that with jQuery:
HTML:
<div id="container">
<div id="content">
Very long text or images or whatever you need
</div>
</div>
CSS:
#container {
overflow: scroll;
width: 200px;
}
#content {
width: 400px;
}
JS:
var maxScroll = $("#content").width() - $("#container").width();
// maxScroll would be 200 in this example
In your case window is the parent/container and document the child/content.
Here is a JSFiddle with this example: http://jsfiddle.net/yP3wW/
Simple solution is
var maxScrollLeft = $(document).width() - $(window).width();