Monday, January 9, 2012

jquery iframe auto height

A simple solution for automatically resize iframe height depending on content.
In page call jQuery library and in head script part past below script.

$(function () {
$('#myIframe').load(function () {
   this.style.height =
   this.contentWindow.document.body.offsetHeight + 'px';
});
});

No comments: