JavaScript special effect instance 005-control the center display in the pop-up window, javascript005-

Source: Internet
Author: User

JavaScript special effect instance 005-control the center display in the pop-up window, javascript005-
In the instance 005 control pop-up window, center displays the instance description, click the button on the page, and the window is centered. Technical points this example first applies the open () method of the window object in JavaScript to open a new window of the specified size, and then obtains the screen resolution through the screen object, then, based on the obtained value, move the new window to the center position of the screen using the moveTo () method of the window object. The moveTo () method moves the window to the specified coordinate (x, y). The syntax format is as follows.

window.moveTo(x,y)

The x and y parameters indicate the coordinates at which the window is moved. The screen object is a screen object in JavaScript, reflecting the screen settings of the current user.
Common Properties of screen objects
Attribute Description
Width Horizontal size of the user's entire screen, in pixels
Height The vertical size of the entire screen, in pixels.
PixelDepth The number of digits in each pixel of the monitor.
ColorDepth Returns the number of digits used in the current color settings. 1 indicates black and white, 8 indicates 256 colors, 16 indicates enhancement colors, and 24/32 indicates true colors.
Color. The 8-bit color supports 256 colors, and the 16-bit color (usually called "enhanced color") supports about 64000 colors.
The 24-digit color (usually called "true color") supports about 16 million colors.
AvailHeight Returns the vertical size of the window content area, in pixels.
AvailWidth Returns the horizontal size of the window content area, in pixels.
Current process 1. window to be popped up new.html
<Html> 2.The page index.html of the current function
<Span style = "font-size: 14px;"> Note: The content of the style label is css. We focus on the content in the script label. In this way, our instance is ready.




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.