Home > Web Front-end > JS Tutorial > body text

js ideas and operations for obtaining computer resolution_javascript skills

WBOY
Release: 2016-05-16 17:12:59
Original
1477 people have browsed it

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:


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!