版权声明:本文为博主原创文章,未经博主允许不可转载。转载请注明出处 https://blog.csdn.net/qq_32442967/article/details/87068240
js获取窗口宽度
function getWidth() {
var winWidth;
if(window.innerWidth) {
winWidth = window.innerWidth;
} else if((document.body) && (document.body.clientWidth)) {
winWidth = document.body.clientWidth;
}
console.log(winWidth);
}