日期:2014-05-17 浏览次数:20642 次
var width = window.innerWidth; var height = window.innerHeight; if(typeof width != "Number"){ // IE width = document.compatMode == "CSS1Compat" ? document.documentElement.clientWidth : document.body.clientWidth; height = document.compatMode == "CSS1Compat" ? document.documentElement.clientHeight : document.body.clientHeight; } alert(width + "-------" + height)