Home >Web Front-end >JS Tutorial >jQuery popup layer is always vertically centered relative to the screen or current window_jquery
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: