码迷,mamicode.com
首页 > Windows程序 > 详细

原生js获取window高和宽

时间:2015-07-26 10:58:20      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:

视口的宽和高

var pw = window.innerWidth,
	ph = window.innerHeight;

	if(typeof pw != "number"){

		
			pw = document.documentElement.clientWidth;
			ph = document.documentElement.clientHeight;
		

	}


	console.log(pw,ph);

 

原生js获取window高和宽

标签:

原文地址:http://www.cnblogs.com/xupeiyu/p/4677252.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!