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