JavaScript Window Function Guide Control Window

zhaozj2021-02-08  252

JavaScript Window Function Guide Control Window

(Author: hear the wind compiler 2001 at 11:35 on January 19)

Once you get the variable indicating the window, you can manipulate it through a variety of ways. In the previous introduction, we discussed a close () method: win = window.open ("http://www.docjs.com/", "js"); Win.Close (); JavaScript provides many ways Properties, we can use them to control the window. Move, scroll, change the size below (N4 , IE4 ) Responsible for the movement, scrolling, and size change operation: // Mobile window to the specified offset x, y (absolutely mobile) Window.moveto IX, IY) / / The screen position of the mobile window to the specified offset X, Y (relative movement) Window.Moveby (ix, iX, IX, IX, IX, IX, IX, IX, Y (absolute scrolling) Window.ScrollTo (ix, iy) // Scroll window screen position to the specified offset X, Y (relative scrolling) Window.Scrollby (ix, xi) // change window size to the specified height and width (absolute change WINDOW.RESIZETO (iWidth, Iheight) // Change the window size to the specified height and width (relative change size) WINDOW.RESizeby (ix, ie) Note that these methods belong to the Window object, so they are smart in the current window or other The window that can be referenced is executed. If you want to dynamically set the location and size of the window, you can use the Move and Resize methods after the window is created. Note that it is impossible to control a window containing another server page. Maximize the window We now introduce how to make a button to maximize the window after clicking. Let's take a look at the HTML and JavaScript code about this button: