Setting Window Height and Width(Firefox) : Window « Window Browser « JavaScript DHTML






Setting Window Height and Width(Firefox)

  
<HTML>
<HEAD>
<TITLE>Window Sizer</TITLE>
<SCRIPT LANGUAGE="JavaScript">
var originalWidth = window.outerWidth
var originalHeight = window.outerHeight

function setInner(width, height) {
    window.innerWidth = width
    window.innerHeight = height
}

function setOuter(width, height) {
    window.outerWidth = width
    window.outerHeight = height
}

function restore() {
    window.outerWidth = originalWidth
    window.outerHeight = originalHeight
}
</SCRIPT>
</HEAD>
<BODY>
<FORM>
<B>Setting Inner Sizes</B><BR>
<INPUT TYPE="button" VALUE="600 Pixels Square" onClick="setInner(600,600)"><BR>
<INPUT TYPE="button" VALUE="300 Pixels Square" onClick="setInner(300,300)"><BR>
<INPUT TYPE="button" VALUE="Available Screen Space"
 onClick="setInner(screen.availWidth, screen.availHeight)"><BR>
<HR>
<B>Setting Outer Sizes</B><BR>
<INPUT TYPE="button" VALUE="600 Pixels Square" onClick="setOuter(600,600)"><BR>
<INPUT TYPE="button" VALUE="300 Pixels Square" onClick="setOuter(300,300)"><BR>
<INPUT TYPE="button" VALUE="Available Screen Space"
 onClick="setOuter(screen.availWidth, screen.availHeight)"><BR>
<HR>
<INPUT TYPE="button" VALUE="Cinch up for Win95" onClick="setInner(273,304)"><BR>
<INPUT TYPE="button" VALUE="Cinch up for Mac" onClick="setInner(273,304)"><BR>
<INPUT TYPE="button" VALUE="Restore Original" onClick="restore()"><BR>
</FORM>
</BODY>
</HTML>



           
         
    
  








Related examples in the same category

1.Make a new window
2.Communicating with a New Window
3.Using the window.close() Method to Close a Browser Window
4.Popup window animation (fly across screen)
5.Hyper link to close window
6.Close window and open document in new window
7.Open a new link from a button
8.Open a new window and control its appearance
9.Open multiple windows at one click
10.Resize a window
11.Resize a window to a specified size
12.Scroll the window
13.New Window Laboratory
14.Creating an always Raised Window
15.Window Property Picker
16.Window Resize, motion, maximize
17.Creating a New Window
18.Window Resize Methods
19.Window focus and blur()
20.Opening and Closing Windows
21.Opening a New Window
22. A Main Window Document
23.References to Window Objects
24.Simple Notification: Display Window Info
25.Properties and Methods of the Window Object
26.Capturing Click Events in the Window
27.Contents of a Main Window Document That Generates a Second Window
28. Checking Before Closing a Window
29.Open a window and center it
30.Maximize Window for different browser
31.Scroll Window
32.Preventing a Page from Scrolling
33.Open a new window setting height, width and position
34.Move a window
35.To hide JavaScript errors from the user
36.Using document.write() on the Current Window
37.Using document.write() on Another Window