JQuery window、document、 body

我电脑屏幕分辨率:1440 * 900
 
最大化浏览器,刷新浏览器
alert($(window).width() + "---" + $(window).height());          1423---768
alert($(document).width() + "---" + $(document).height());   2008---2216
alert($("body").width() + "---" + $("body").height());             2000---2200
 
缩小浏览器,刷新页面
alert($(window).width() + "---" + $(window).height());          变小
alert($(document).width() + "---" + $(document).height());  不变
alert($("body").width() + "---" + $("body").height());            不变
 
由此可看出浏览器窗体模型:
$(window):  浏览器显示网页内容的部分,相当于css中的html,(css默认html为整个浏览器窗口的高度。当然,我们可以显示
设置html的width和height)。
 
$(document):整个网页文档流,
$("body"):就是body,嘿嘿
附图:

 

 
原文地址:https://www.cnblogs.com/youxin/p/3372171.html