Hi Jan,
(Sorry for the e-mail, I'm using a different computer right now and I accidentily clicked "Reply"
I think you have misinterpreted a line in the article on MSDN. It states the following for the scrollWidth property:
"The width is the distance between the left and right edges of the object's visible content."
By "visible content" they are referring to the "visibility" of the "content", not the display rectangle. In other words, if there
is content that isn't visible, e.g. a hidden tag, then it won't count towards the total size of the scrollWidth property.
There is an example right on the page that proves that it works. Try it. I also just tested it myself and it worked just fine for
me.
For your own test make sure there are scroll bars on the body itself and not a nested tag such as a div.
Here's my test:
<html>
<head></head>
<body>
<div id="info"></div>
<nobr>
Content Content Content Content Content Content Content Content Content Content Content
Content Content Content Content Content Content Content Content Content Content
Content Content Content Content Content Content Content Content Content Content Content
Content Content Content Content Content Content Content Content Content Content Content
</nobr>
</body>
<script>
window.onresize = window_onresize;
function window_onresize()
{
GetInfo();
}
function GetInfo()
{
info.innerHTML = document.body.scrollWidth + "<br />";
info.innerHTML+= document.body.clientWidth + "<br />";
}
GetInfo();
</script>
</html>