jquery获取当前屏幕的宽度和高度

时间:2020-03-01 18:25:22   收藏:0   阅读:46
技术分享图片
<script type="text/javascript">   

$(document).ready(function()   

{   

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   

}   

)   

</script>   
 
View Code

 

原文:https://www.cnblogs.com/zengxh/p/12390606.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!