jquery让页面中的模块自适应浏览器高度


//加载时适应浏览器高度
$(document).ready(function() {
//模块尺寸
$('#div_frame_body').css('height', $(window).height());
$('#div_frame_main').css('height', $(window).height() - 110);
$('#div_frame_left').css('height', $(window).height() - 115);
$('#div_frame_right').css('height', $(window).height() - 110);
$('#div_frame_tree').css('height', $(window).height()-5);
$('#div_frame_list').css('height', $(window).height()-5);
$('#frame_left').css('height', $(window).height() - 115);
$('#frame_right').css('height', $(window).height() - 110);
})
//改变窗体大小时适应浏览器高度
$(window).resize(function() {
//模块尺寸
$('#div_frame_body').css('height', $(window).height());
$('#div_frame_main').css('height', $(window).height() - 110);
$('#div_frame_left').css('height', $(window).height() - 115);
$('#div_frame_right').css('height', $(window).height() - 110);
$('#div_frame_tree').css('height', $(window).height());
$('#div_frame_list').css('height', $(window).height());
$('#frame_left').css('height', $(window).height() - 115);
$('#frame_right').css('height', $(window).height() - 110);
});
$('#div_frame_body').css('height', $(window).height());使用juqery函数获取浏览器窗体的高度,后面减去的是已经占用的具体高度


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM