移动端的文本框获取焦点时导致fixed或absolute定位的按钮被手机键盘顶上去的问题

var win_h = $(window).height();//关键代码
window.addEventListener('resize', function () {
    if($(window).height() < win_h){
        $('.share-btn-box').hide();
    }else{
        $('.share-btn-box').show();
    }
});

猜你喜欢

转载自www.cnblogs.com/ivan5277/p/11247314.html