jq设置高度随浏览器变化而变化

原创 a752989797 随笔 jq 227阅读 2017-11-22 18:22:39 举报

//设置列表高度
function setMessageListHeight(){
var winHeight = $(window).height();
winHeight = winHeight -225;
if(winHeight<36){
winHeight = 36;
}
$("#message-list").css("height",winHeight);
$(window).resize(function() {
winHeight = $(window).height();
winHeight = winHeight -225;
if(winHeight<36){
winHeight = 36;
}
$("#message-list").css("height",winHeight);
});
}

评论 ( 0 )
最新评论
暂无评论

赶紧努力消灭 0 回复