调整窗口大小时获取文档的大小 [英] Get the size of a document when window resize

查看:45
本文介绍了调整窗口大小时获取文档的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I can find the size of window, when i resize my window.like this

<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>

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

Now i want to get the document size when i resize the window. How can i get the size every time when resize the window.

推荐答案

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

$(window).width(); // returns width of browser viewport

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

$(document).width(); // returns width of HTML document

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

这篇关于调整窗口大小时获取文档的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆