原生代码屏幕等高

<script type="text/javascript">


var maxWidth =0;
var maxHeight=0;
var imgHeight;

window.onload=function(){

maxHeight = document.documentElement.clientHeight;
maxWidth = document.documentElement.clientWidth;
document.getElementById("adapp").style.height=maxHeight+"px";

//当浏览器窗口大小改变时,设置显示内容的高度
window.onresize=function(){
changeDivHeight();
}
function changeDivHeight(){
maxHeight = document.documentElement.clientHeight;
document.getElementById("adapp").style.height=maxHeight+"px";
}
}



</script>

posted @ 2015-01-13 10:40  dadaazi  阅读(96)  评论(0编辑  收藏  举报