screen.width和screen.height有多可靠
How reliable is screen.width and screen.height?
我想制作一个具有"响应式设计"的web应用程序,将JavaScript屏幕分辨率发布回服务器,并根据这些信息做出决定,但问题是我能否依靠window.screen始终提供正确的笔记本电脑、平板电脑和智能手机信息?
当然,考虑到它只支持现代浏览器和设备。
是的,screen.width
和screen.height
是可靠的,但是您可能会对布局页面的窗口大小更感兴趣。例如,CSS3中的@media
查询使用窗口大小,而不是屏幕大小。
相关文章:
- 分析高度属性时出现意外值{{specs.height}}.index.html
- $(document).height()在刷新时随机化值(Safari 5.1.10)
- 在刚刚调用的append函数之后,jquery.height()不会返回实际值
- Phonegap css height%不适用于android 4.2-4.3
- $(document).height和$(window).heaght都返回相同的值-使用的是正确的doctype
- $(window).height() inside iframe?
- 如何在PhantomJS中更改window.screen尺寸
- document和window height返回相同的值
- HTML5画布y-height不正确
- TinyMCE/IE9/DIV with Width/Height/ContentEditable/如何阻止DIV选择
- 如果screen.height低于460px,请删除一个类
- jQuery Height 无法正常工作
- 如何将 screen.width 值替换为我自己定义的值
- 使用 angularJs 修改 css.height 会导致 Internet Explorer 无法滚动到页面底部
- window.screen.width和window.screen.height在iPad3上不起作用
- 当屏幕 CSS 像素比大于 1 时,在不同的浏览器上获取相同的 window.screen.height 和 windo
- Android浏览器的screen.width,screen.height和window.innerWidth和wind
- canvas.height与screen.availHeight显示不同的值
- screen.width和screen.height有多可靠
- 如何使body的最小高度等于screen.height