原生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);
原文地址:https://www.cnblogs.com/xupeiyu/p/4677252.html