Using doScrollIn the Internet Explorer, the doScroll method enables you to simulate a mouse click on a scrollbar using this syntax: document.body.doScroll([ scrollAction ]) Here, scrollAction is a string that can take one of these values:
Here's an example that scrolls a web page downward when the user clicks a button: (Listing 09-12.html on the web site)<HTML> <HEAD> <TITLE> Using the doScroll Method </TITLE> <SCRIPT LANGUAGE="JavaScript"> <!-- function scroller() { document.body.doScroll("scrollbarDown") } // --> </SCRIPT> </HEAD> <BODY> <H1>Using the doScroll Method</H1> <FORM> <INPUT TYPE="BUTTON" ONCLICK="scroller()" VALUE="Click Me!"> </FORM> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> </BODY> </HTML> |