How to dynamically resize an iFrame in Firefox?

I used the solution indicated on this page to resize the iFrame depending on the content:

Content-based iframe resizing

And it works great except Firefox. In Firefox, other content is disabled, but as you continue to refresh the page, the browser will slowly display the rest of the content. I saw someone answer that this is the solution to the problem:

Use jQuery to get body height in framed.html (FF problem, body height kept): var height = $ (Document.body) .height ();

However, I do not know where to put this line of code. Am I pasting it somewhere in 3 snippets of scripts of the original solution? If so, where can I put it?

+2
source share
2 answers

I have already decided this. In case someone else might run into the same problem, I used the code on the webpage below, which is slightly different from the link I gave above:

http://solidgone.org/Set-IFRAME-height-based-on-size-of-remotely-loaded-content

0
source

At www.bar.net/framed.html: Use jQuery to get body height in framed.html (FF problem, the body continues to grow):

change the following code

// What the page height? var height = document.body.scrollHeight; 

from

 var height = $(document.body).height(); 
0
source

All Articles