window.scrollTo() : Window Object : Window JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Window » Window Object »

 

window.scrollTo()









Syntax








window.scrollTo(numX, numY)



The scrollTo() method scrolls the window to the specified location.












<html>
    <head>
    <script language="JavaScript1.2">
    <!--
    function scrollWin(form){
      var myX = form.X.value;
      var myY = form.Y.value;

      window.scrollTo(myX, myY);
    }
    -->
    </script>
    </head>
    <body>
    <form>
      <b>X-Coordinate:</b>
      <input type=TEXT name="X"><br>
      <b>Y-Coordinate:</b>
      <input type=TEXT name="Y"><br>
      <input type=BUTTON value="Scroll Window" onClick="scrollWin(this.form)"></td>
    </form>
    </body>

    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Window
» Window Object