Reputation: 59
I have been desperately trying to find a way to resize my iframe according to its content. I have a working script I found here but chrome still won't work. The frame does become bigger but it won't become smaller. I've tried so many codes but to no avail. (iframes are not my choice btw) I'm no expert in js and jquery so please guide me if you can. thanks
Upvotes: 2
Views: 309
Reputation: 3919
In Chrome, the body height is defined by the height of its container, there is a circular definition if you define the size of the container by the size of the iframe body. The solution that I've found is to set the position of the iframe's body as absolute.
You can see a demo here: http://webapps.so/labs/iframe/page.html
Upvotes: 1