auto_height.js 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. // JavaScript Document
  2. /**
  3. *
  4. * 页面js效果
  5. * @author cql 2014-01-09
  6. */
  7. //高度自适应
  8. window.onload=window.onresize=function(){
  9. var wh=$(window).height();
  10. var wd=$(window).width();
  11. var header=$(".header").height();
  12. var kong=$(".kong").height();
  13. var maintop_r=$(".maintop_r").height();
  14. var pro_icon=$(".pro_icon").height();
  15. $(".main").css("height",wh-header-kong-20+"px");
  16. $(".maintop_con").height($(".maintop_r").height()-$(".sys_tit").height()-2);
  17. $(".list").height($(".right").height()-40);
  18. $(".pro_con").height($(".list_l_con").height()-pro_icon-2);
  19. $(".mainbottom_con").height($(".mainbottom").height()-kong);
  20. $(".mainbottom_con_mains").height($(".mainbottom_con_lr").height()-$(".tod_tit").height()-2);
  21. $(".mainbottom_con_bodys").height($(".mainbottom_con_lr").height()-$(".tod_tit").height()-2);
  22. if(wd <1024){
  23. $(".list").height($(".right").height()-40);
  24. } else{
  25. $(".list").height($(".right").height()-40);
  26. }
  27. //$(".wd").height($(".mainbottom_con_body").height());
  28. //$(".data").height($(".wd").height()-$(".wd ul").height()-36);
  29. };