Home >Web Front-end >JS Tutorial >js ideas and operations for obtaining computer resolution_javascript skills

js ideas and operations for obtaining computer resolution_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:12:591536browse

When making a page, the user requires different resolutions and different positions of the pop-up window. I wonder if I should first obtain the screen width, then pay the value to the variable, and then set the parameters in onclick

Copy code The code is as follows:

<script> <br>alert(screen.width "*" screen.height) <br> </script>

Copy code The code is as follows:

< ;script>
function centerWindow(url,w,h){
l=(screen.width-w)/2
t=(screen.height-h)/2
window.open (url,'','left=' l ',top=' t ',width=' w ',height=' h)
}


----------------------------- ----------------------------------



---------------------------------- ----------------------------



This code displays different pages according to different screens

The following is how to pass this parameter
Copy the code The code is as follows:


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