项目中经常用到的方法,放这边省的写其他项目用到了还要重新写或者翻以前项目
 
function clientXY(){
    if(window
.innerHeight 
!== undefined
){
        return {
            width
: window
.innerWidth
,
            height
: window
.innerHeight
        
}
    }else if(document
.compatMode 
=== "CSS1Compat"){
        return {
            width
: document
.documentElement
.clientWidth
,
            height
: document
.documentElement
.clientHeight
        
}
    }else{
        return {
            width
: document
.body
.clientWidth
,
            height
: document
.body
.clientHeight
        
}
    }
}
                
                
                
        
    
                    转载请注明原文地址: https://mac.8miu.com/read-502922.html