jQuery动态设置输出窗口的高度

window.onscroll = function () { sc(); };//当系统滚屏时触发
window.onresize = function () { sc(); };//改变窗口大小时触发
window.onload = function () { sc(); };//页面加载时触发

function sc() {
    var h = document.documentElement.clientHeight - 110;//document.documentElement.clientHeight为当前页面高度,110为需要剪掉的固定高度
    $("#result").css({ height: h });//设置的动态高度
    $("#result").css("overflow-y", "scroll");
    $("#result").css("overflow-x", "scroll");
}

原文地址:https://www.cnblogs.com/QiuJL/p/4524233.html