原生js获取window高和宽
视口的宽和高
var pw = window.innerWidth,
ph = window.innerHeight;
if(typeof pw != "number"){
pw = document.documentElement.clientWidth;
ph = document.documentElement.clientHeight;
}
console.log(pw,ph);
视口的宽和高
var pw = window.innerWidth,
ph = window.innerHeight;
if(typeof pw != "number"){
pw = document.documentElement.clientWidth;
ph = document.documentElement.clientHeight;
}
console.log(pw,ph);