make iframe height dynamic based on content inside- JQUERY/Javascript

前端 未结 20 2235
情书的邮戳
情书的邮戳 2020-11-22 07:42

I am loading an aspx web page in an iframe. The content in the Iframe can be of more height than the iframe\'s height. The iframe should not have scroll bars.

I have

20条回答
  •  萌比男神i
    2020-11-22 07:56

    $(document).height() // - $('body').offset().top
    

    and / or

    $(window).height()
    

    See Stack Overflow question How to get the height of a body element.

    Try this to find the height of the body in jQuery:

    if $("body").height()
    

    It doesn't have a value if Firebug. Perhaps that's the problem.

提交回复
热议问题