JavaScript Reference/Javascript Methods/scroll
"scroll()" Example
<html>
<body>
<script language="JavaScript">
function function1(){
window.scrollTo(200,200);
}
function function2(){
window.scroll(200,200);
}
</script>
<input type="button" value="Scroll to (200,200)" onClick="function1();">
<input type="button" value="Scroll(200,200)" onClick="function2();">
<div style="height:1000;width:1500;background-color:blue;"></div>
</body>
</html>
"scroll()" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |window |
+----------------+--------------------------------------------------------------+
"scroll()" Syntax, Parameters and Note
Note:
Scrolls the window to the specified values.
Syntax:
window.scroll(param1, param2)
Parameters:
param1 Required; the horizontal scroll amount in pixels.
param2 Required; the vertical scroll amount in pixels.