Resizing an iframe based on content

后端 未结 21 2451
南方客
南方客 2020-11-21 07:40

I am working on an iGoogle-like application. Content from other applications (on other domains) is shown using iframes.

How do I resize the iframes to fit the heigh

21条回答
  •  终归单人心
    2020-11-21 08:05

    The solution on http://www.phinesolutions.com/use-jquery-to-adjust-the-iframe-height.html works great (uses jQuery):

    
    

    I don't know that you need to add 30 to the length... 1 worked for me.

    FYI: If you already have a "height" attribute on your iFrame, this just adds style="height: xxx". This might not be what you want.

提交回复
热议问题