Increasing iframe height
I am loading a "html" page in to a div( ex: #targets) using jquery load().The the div comes under the iframe. After loading the html file, the div height and ifram开发者_运维知识库e height not getting increased based on the html file content height.
How to change the iframe and div height based on the htm contents in the div.
try this css code:
div, iframe
{
overflow:auto;
height:auto;
}
I suggest reading this blog post
jQuery iFrame Sizing
// For some browsers (for opera, safari check blog post, chrome?)
$('iframe').load(function() {
this.style.height =
this.contentWindow.document.body.offsetHeight + 'px';
});
精彩评论