js移动端键盘弹出收起事件处理

var clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
$(window).on('resize', function (e) {
    var nowClientHeight = document.documentElement.clientHeight || document.body.clientHeight;
    if (clientHeight > nowClientHeight) {
        //键盘弹出的事件处理

    }
    else {
        //键盘收起的事件处理
        alert('收起')
    }
});

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: