screen.availHeight和window.height()的区别
- 论坛
- screen.availHeight和window.height()的区别
8 浏览
screen.availHeight和window.height()的区别
我在我的浏览器(Firefox)上执行以下Javascript代码:
- console.debug("屏幕高度 = "+ screen.availHeight); //输出 770
- console.debug("窗口高度 ="+ $(window).height()); //输出 210(我也使用了jQuery)
这两者有什么区别?770是以像素为单位,210是以毫米为单位吗?
同样,当我写$(document).height()
和$(window).height()
时,有一些差异。这是什么原因?