You are here: irt.org | FAQ | JavaScript | Scroll | Q555 [ previous next ]
Although the scroll method was introduced in Netscape Navigator 3, this only allows the document to be scrolled to a particular point in the document. The scrollBy method introduced in Netscape Navigator 4 and Internet Explorer 4 allows the document to be scrolled in increments:
<script language="JavaScript"><!--
if (document.layers || document.all) {
document.write('<form>');
document.write('<input type="button" value="Up" onClick="parent.frame2.scrollBy(0,-100)">');
document.write('<input type="button" value="Down" onClick="parent.frame2.scrollBy(0,100)">');
document.write('<\/form>');
}
//--></script>