应用商店改版

出现一个问题:屏幕很高的话,比如大显示器,

页面内容很少的话,最大化浏览器,最下面就是空白的:


js 兼容屏幕的高度
 

Js代码  js 兼容屏幕的高度
  1. //兼容页面的高度,因为如果Pc端屏幕是大屏幕的话,最下面是空白的  
  2.             var $divConction=$('div.conction');  
  3.             var height=$divConction.height();//获取div的实际高度  
  4.             console.log("height:"+height);  
  5.             var docHeight=$(document).height();//浏览器当前窗口文档的高度  
  6.             var delteHeight=docHeight-height-210;  
  7.             if(delteHeight>0){  
  8. //如果是大屏,则增加div的高度,把内容撑开,使footer始终在最下面  
  9.                 $divConction.height(height+delteHeight);  
  10.             }  
  11.             console.log(docHeight);  

 

Js代码  js 兼容屏幕的高度
  1. adapteHeight:function (e) {  
  2.             var $divConction=$('div.con-fl');  
  3.             var height=$divConction.height();  
  4.             console.log("height:"+height);  
  5.             var docHeight=$(document).height();//浏览器当前窗口文档的高度  
  6.             var delteHeight=docHeight-height-254;//172  
  7.             if(delteHeight>0){  
  8.                 $divConction.height(height+delteHeight);  
  9.             }  
  10.             console.log(docHeight);  
  11.         },  

 

参考:http://www.cnblogs.com/hoojo/archive/2012/02/16/2354663.html

相关文章:

  • 2021-06-15
  • 2022-12-23
  • 2022-01-12
  • 2022-01-08
  • 2022-01-08
  • 2021-11-18
  • 2021-10-15
猜你喜欢
  • 2022-01-08
  • 2022-01-08
  • 2022-12-23
  • 2021-11-18
相关资源
相似解决方案