---
title: "document document.body."
author: "mssp"
date: "2013-11-29T19:25:37Z"
tags: []
categories: ["Web前端"]
slug: "document-document-body"
draft: false
lastmod: "2013-12-04T12:23:43Z"
id: 1983074
url: "https://mssp.iteye.com/blog/1983074"
---

$("#editor").parent().parent();
$(document).children.outerHTML;


clientHeight可视区域
scrollHeight滚动区域
<script>
var dom1=document.getElementById("p").clientHeight;
var dom2=document.getElementById("p").scrollHeight;
var x=dom1-dom2
x>=0?alert("没有"):alert("有,挡住了"+x*(x>0?1:-1)+"像素")
</script>

------------------
电脑屏幕分辨率：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)：  浏览器显示网页内容的部分
$(document):整个网页文档流
$("body"):就是body，嘿嘿