2

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

Resizing an iframe based on content

And it works perfectly, except in Firefox. In Firefox, the other content is cut-off but once you keep on refreshing the page, the browser will slowly reveal the rest of the content. I saw someone replied that this is the solution to the problem:

Use jQuery to get the body height in framed.html (FF issue, body kept growing): var height = $(document.body).height();

However, I don't know where to put that line of code. Do I insert it somewhere within the 3 snippets of scripts on the original solution? If so, where do I put it?

Community
  • 1
  • 1
catandmouse
  • 9,337
  • 20
  • 74
  • 128

2 Answers2

0

In www.bar.net/framed.html: Use jQuery to get the body height in framed.html (FF issue, body kept growing):

change following code

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

with

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

I already solved it. In case somebody else might be encountering the same problem, I used the code on the web page below which is slightly different from the link I gave above:

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

catandmouse
  • 9,337
  • 20
  • 74
  • 128