Jquery—屏幕高度和宽度
$(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 type="text/javascript">
$(function(){
//为div设置边框
$("#container").css("border","1px solid gray");
//改变div的高度
$("#container").height($(window).height());
//改变div的宽度bai
$("#container").width($(window).width());
});
</script>