js

处理移动安卓键盘弹出时,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)