Div at bottom of window and adaptable height div

前端 未结 6 770
半阙折子戏
半阙折子戏 2021-01-03 05:00

Is there a way to get a div to always be at the bottom of the window, and another div to change its height to fill any space that it leaves, and that div will scroll if its

6条回答
  •  醉话见心
    2021-01-03 05:38

    You can use the following solution to get the orange div to do what you want:

    if ( ( $('.container-with-footer').height() ) < ( $(window).height() ) ) {
        $('footer').css({
            "position":"absolute",
            "left":"0",
            "right":"0",
            "bottom":"0"
        })
    }
    

提交回复
热议问题