Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我调整浏览器窗口的大小时,我需要获取正文元素的高度和宽度
请帮助我使用 JQuery 解决这个问题
在窗口对象上使用 resize 事件:
$(window).resize(function(){ var width = $(document).width(), // or $(window).width() height = $(document).height(); // or $(window).height() });