取不同浏览器可视区域宽高方法

原文链接: http://www.cnblogs.com/hilxj/p/9745554.html
function getViewportOffset(){
if( window. innerWidth){
return {
w:window. innerWidth,
t:window. innerHeight
}
} else if( document. compatMode == "BackCompat"){
return {
w:document. body. clientWidth,
t:document. body. clientHeight
}
} else{

return {
w:document. documentElement. clientWidth,
t:document. documentElement. clientHeight
}
}
}

转载于:https://www.cnblogs.com/hilxj/p/9745554.html

猜你喜欢

转载自blog.csdn.net/weixin_30764771/article/details/94830152
今日推荐