javascript中client()兼容性封装

function client() {
    var clientWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth || 0;
    var clientHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0;
    var o = {};
    o.width = clientWidth;
    o.height = clientHeight;
    return o;
}

 

posted @   萧诺  阅读(345)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示