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


JAVASCRIPT TUTORIALS » Window » Window Object »

 

window.resizeBy()













Syntax








window.resizeBy(numHort, numVert)



The resizeBy() method resizes the specified window by the number of pixels.

The numHort represents the number of horizontal pixels.

The numVert represents the vertical number of pixels.

If the numbers passed are positive, the window size is increased.

Negative numbers reduce the size of the window.












<html>
    <head>
    <script language="JavaScript1.2">
    <!--
    function resizeWin(dir, dist){
      var myVert;
      var myHorz;

      if(dir == "vert"){
        myHorz = 0;
        myVert = dist;
      }else{
        myHorz = dist;
        myVert = 0;
      }
      window.resizeBy(myHorz, myVert);
    }
    -->
    </script>
    </head>
    <body>
    <form>
    <table border=0>
      <tr>
      <td><input type=BUTTON value="Expand Down" onClick="resizeWin('vert',10)"></td>
      </tr>
      <tr>
    <td><input type=BUTTON value="Retract From Right" onClick="resizeWin('horz',-10)"></td>
        <td><input type=BUTTON value="Grow Right" onClick="resizeWin('horz',10)"></td>
      </tr>
      <tr>
      <td><input type=BUTTON value="Retrack Up" onClick="resizeWin('vert',-10)"></td>
      </tr>
    </table>
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Window
» Window Object