Jquery problem with height() and resize()

后端 未结 2 1110
执念已碎
执念已碎 2020-12-21 14:42

I need to give an element a specific height based on document\'s height and keep it whether the document size changes:

$(document).ready(function () {
    $(         


        
2条回答
  •  旧时难觅i
    2020-12-21 15:11

    Something like this seems to work fine for me:

    $(function() {
        $("div#test").css("height", ($(document).height() - 325) + "px");
    });
    

提交回复
热议问题