Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在查看我的网页时,我如何能够获取用户的屏幕大小或浏览器分辨率(仅限宽度),最好使用 javaScript/jQuery 或 PHP 并输出结果?
window.innerWidth将为您提供浏览器宽度。
window.innerWidth
screen.width将为您提供显示器的分辨率。
screen.width
这是一个例子:http: //jsbin.com/abomod/1/edit