我需要得到所述主体元件的高度和宽度,当我调整浏览器窗口

请帮我解决使用JQuery这个问题

有帮助吗?

解决方案

的窗口对象上使用resize事件:

$(window).resize(function(){
  var width = $(document).width(), // or $(window).width()
      height = $(document).height(); // or $(window).height()
});
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top