rAthus icon

Set iFrame height from content

rAthus | PRO | 04/24/17 02:35:56 PM UTC | 0 ⭐ | 597 👁️ | Never ⏰ | []
JavaScript |

280 B

|

None

|

0 👍

/

0 👎

var body = document.body,
    html = document.documentElement;
var iframe_content_height = Math.max(body.scrollHeight,body.offsetHeight,html.clientHeight,html.scrollHeight,html.offsetHeight)+20;
window.parent.document.getElementById('iframe_id').height = iframe_content_height+'px';

Comments