使用jquery中height()方法获取各种高度大全

Summer ·
更新时间:2024-09-20
· 601 次阅读

代码如下:
alert($(window).height()); //浏览器当前窗口可视区域高度

alert($(document).height()); //浏览器当前窗口文档的高度

alert($(document.body).height());//浏览器当前窗口文档body的高度

alert($(document.body).outerHeight(true));//浏览器当前窗口文档body的总高度 包括border padding margin

alert($(window).width()); //浏览器当前窗口可视区域宽度

alert($(document).width());//浏览器当前窗口文档对象宽度

alert($(document.body).width());//浏览器当前窗口文档body的高度

alert($(document.body).outerWidth(true));//浏览器当前窗口文档body的总宽度 包括border padding margin



height 方法 jQuery

需要 登录 后方可回复, 如果你还没有账号请 注册新账号
相关文章
Flavia 2020-02-10
602