//浏览器窗口的内部宽度
var w = window.innerWidth //对于Internet Explorer、Chrome、Firefox、Opera 以及 Safari
|| document.documentElement.clientWidth //Internet Explorer 8、7、6、5
|| document.body.clientWidth
//浏览器窗口的内部高度:
var h = window.innerHeight
|| document.documentElement.clientHeight
|| docuement.body.clientHeight