移动端安卓定位随键盘浮起

  1. var client_h = document.documentElement.clientHeight;  
  2.             $(window).on("resize",function(){  
  3.                 var body_h =  document.body.scrollHeight;  
  4.                 if(body_h < client_h){  
  5.                     $(".operate").removeClass("fixed");  
  6.                     console.log("小了");  
  7.                 }else{  
  8.                     console.log("正常");  
  9.                     $(".operate").addClass("fixed");  
  10.                 }  
  11.             }); 

猜你喜欢

转载自blog.csdn.net/cheeso/article/details/79269834