当前位置:编程学习 > JAVA >>

document.compatMode == "CSS1Compat"

[javascript] 
var width = window.innerWidth;  
var height = window.innerHeight;  
if(typeof width != "Number"){  // IE  
    width = document.compatMode == "CSS1Compat" ? document.documentElement.clientWidth : document.body.clientWidth;  
    height = document.compatMode == "CSS1Compat" ? document.documentElement.clientHeight : document.body.clientHeight;  
}  
alert(width + "-------" + height)  
 
补充:web前端 , JavaScript ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,