mui软键盘顶起底部选项卡

var originalHeight=document.documentElement.clientHeight || document.body.clientHeight;

window.onresize=function(){

    //软键盘弹起与隐藏  都会引起窗口的高度发生变化
    var  resizeHeight=document.documentElement.clientHeight || document.body.clientHeight;

    if(resizeHeight*1<originalHeight*1){ //resizeHeight证明窗口被挤压了
        $('.dibtab').css('display','none');
        $(".mui-iframe-wrapper").css('bottom','0px');
    }else{
        $('.dibtab').css('display','block');
        $(".mui-iframe-wrapper").css('bottom','50px');
    }
}

你可能感兴趣的:(javascript)