标签:oppo com height mode firefox var type blog 兼容性
var leftPos = (typeof window.screenleft == "number")? window.screenleft : window.screenX; var topPos = (typeof window.screentop == "number")? window.screentop : window.screenY; //IE Safai Opera Chrome 支持window.screenleft //Firefox 支持 window.screenX
var pageWidth = window.innerWidth, pageHeight = window.innerHeight; if (typeof pageWidth != "number") { if(document.compatMode == "CSS1Compat") { //判断是否处于标准模式 pageWidth = document.documentElement.clientWidth; pageHeight = document.documentElement.clientHeight; } else { pageWidth = document.body.clientWidth; //兼容IE pageHeight = doucment.body.clientHeight; } }
标签:oppo com height mode firefox var type blog 兼容性
原文地址:http://www.cnblogs.com/hkie/p/6017849.html