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

前端 未结 20 2316
情书的邮戳
情书的邮戳 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条回答
  •  清歌不尽
    2020-11-22 08:00

    You can refer related question here - How to make width and height of iframe same as its parent div?

    To set dynamic height -

    1. We need to communicate with cross domain iFrames and parent
    2. Then we can send scroll height/content height of iframe to parent window

    And codes - https://gist.github.com/mohandere/a2e67971858ee2c3999d62e3843889a8

提交回复
热议问题