Which browser? A quick test in Firefox works.
I am having this HTML code .....
-
<body onLoad = _test()>
-
<input type='text' id='text_id'/>
-
<div style='width:2000px;height:2000px' id='div_id'>
-
</div>
-
</body>
-
And this is my JavaScript code ..
-
function test(){
-
alert(document.body.scrollLeft+'\t'+document.body.scrollTop);
-
}
-
function _test(){
-
window.onscroll = test;
-
}
-
When horizontal or vertical scroll bars gets scrolled then the both of the values come 0 ...... in Mozilla and in IE both ..
What's wrong with it .... ?