I need a solution for auto-adjusting the width
and height
of an iframe
to barely fit its content. The point is that the width and height can be changed after the iframe
has been loaded. I guess I need an event action to deal with the change in dimensions of the body contained in the iframe.
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
In case someone getting to here: I had a problem with the solutions when I removed divs from the iframe - the iframe didnt got shorter.
There is an Jquery plugin that does the job:
http://www.jqueryscript.net/layout/jQuery-Plugin-For-Auto-Resizing-iFrame-iFrame-Resizer.html
I am using this code to autoadjust height of all iframes (with class autoHeight) when they loads on page. Tested and it works in IE, FF, Chrome, Safari and Opera.
In jQuery, this is the best option to me, that really help me!! I wait that help you!
iframe
jQuery