window.pageYOffset : Window Object : Window JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Window » Window Object »

 

window.pageYOffset







The pageYOffSet property reflects the current vertical pixel location of the top-left corner of the document.












<html>
    <head>
    <script language="JavaScript1.2">
    <!--
    function showLocation(){
      var x = self.pageXOffset;
      var y = self.pageYOffset

      var currX = "X-coordinate: " + x + "n";
      var currY = "Y-coordinate: " + y;
      window.alert(currX + currY);
    }
    -->
    </script>
    </head>
    <body>
    <form>
      <input type=BUTTON value="Show Location" onClick="showLocation()">
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Window
» Window Object