开发者

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';
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜