var width = window.innerWidth; var height = window.innerHeight; if(typeof width != 'number'){//IE 5/6/7/8 if(document.compatMode == 'CSS1Compat'){ width = document.documentElement.clientWidth; height = document.docuementElement.clientHeight; }else{ width = document.body.clientWidth; height = document.body.clientHeight; }
计算window窗口大小
最新推荐文章于 2022-10-22 15:23:52 发布