解决移动端的文本框获取焦点时导致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();
    }
});

posted @ 2020-05-09 15:36  安雁-zzq  阅读(264)  评论(0编辑  收藏  举报