pc端: var w = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; var h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; 移动端: 网页可见区域宽:document.body.clientWidth 网页可见区域高:doc