相关疑难解决方法(0)

窗口上的jQuery调整大小

我有以下JQuery代码:

$(document).ready(function () {
    var $containerHeight = $(window).height();
    if ($containerHeight <= 818) {
        $('.footer').css({
            position: 'static',
            bottom: 'auto',
            left: 'auto'
        });
    }
    if ($containerHeight > 819) {
        $('.footer').css({
            position: 'absolute',
            bottom: '3px',
            left: '0px'
        });
    }
});
Run Code Online (Sandbox Code Playgroud)

唯一的问题是,这仅在浏览器首次加载时有效,我containerHeight还希望在调整窗口大小时进行检查?

有任何想法吗?

html css jquery

178
推荐指数
6
解决办法
43万
查看次数

标签 统计

css ×1

html ×1

jquery ×1