Home >Web Front-end >JS Tutorial >jQuery popup layer is always vertically centered relative to the screen or current window_jquery

jQuery popup layer is always vertically centered relative to the screen or current window_jquery

WBOY
WBOYOriginal
2016-05-16 17:38:381245browse

The pop-up layer is always something that the front-end must deal with. Under normal circumstances, if the pop-up layer has a fixed height and width, it can be done with a style. However, if there is no fixed height or fixed width or fixed height and width, we You need to use JS to process it to dynamically obtain the height or width of the current window; today we have done two situations, one is relative to the screen form, and the other is relative to the current window. Look at the code, it may be useful to you:

Copy code The code is as follows:








//Center the browser window vertically

// The current window is vertically centered







I am The current window, I am the current window, I am the current window, I am the current window, I am the current window, I am the current window
I am the current window, I am the current window, I am the current windowI am the current window, I am the current window, I am the current window
I am the current window, I am the current window, I It is the current window

I am the current window, I am the current window, I am the current window, I am the current window
I am pop-up window 1111
I am pop-up window 1111
I am pop-up window 1111
I am pop-up window 1111
I am pop-up window 1111
I am pop-up window 1111
I am pop-up window 1111

I am pop-up window 2222
I am pop-up window 2222
I am Pop-up window 2222
I am pop-up window 2222
I am pop-up window 2222



< /html>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Solution to conflict between UpdatePanel and Jquery_jqueryNext article:Solution to conflict between UpdatePanel and Jquery_jquery

Related articles

See more