js

作者: Myxy | 来源:发表于2017-11-07 10:29 被阅读0次

处理移动安卓键盘弹出时,fiexd布局被打乱

const compareBodyHeight = function(hg) {
    //判断高度给延迟,处理安卓键盘弹出跳转
    //hg : 高度

        //判断hg的类型
    if(typeof hg != 'number') {
        return console.error(hg + '不是number类型')
    }

    var time = 0;
    console.log('hg', hg)
    if(document.body.scrollHeight < hg) {
        time = 300;
    } else {
        time = 0;
    }
    console.log('time', time)
    return time;
}

export {
    compareBodyHeight
}

相关文章

网友评论

      本文标题:js

      本文链接:https://www.haomeiwen.com/subject/gomdmxtx.html