简体   繁体   中英

Grab the users screen-size/browser resolution

在查看我的网页时(最好使用javaScript / jQuery或PHP)并输出结果时,我如何能够抓住用户的屏幕尺寸或浏览器分辨率(仅宽度)?

window.innerWidth will get you the browser width.

screen.width will get you the monitor's resolution.

Here's an example: http://jsbin.com/abomod/1/edit

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM