在窗口调整大小时获取文档的大小

Ran*_*jit 2 jquery html5

当我调整窗口大小时,我可以找到窗口的大小.就像这样

<script type="text/javascript">

    jQuery(window).resize(function () {
      var width = jQuery(window).width();
      var height = jQuery(window).height();
      console.log(width);
      console.log(height);
    })
</script>
Run Code Online (Sandbox Code Playgroud)

现在我想在调整窗口大小时获取文档大小.每次调整窗口大小时,如何获得大小.

Ste*_*fan 6

$(窗口).WIDTH(); //返回浏览器视口的宽度

(文档)$ .WIDTH(); //返回HTML文档的宽度

http://api.jquery.com/width/