开发者

iframe auto resize in aspx files with vb.net codebehind

I put in the iframe tag as follows in my .aspx page -

Now what code do i put in javascript or vb.net to make this auto resizable depen开发者_如何学运维ding on the size of the page that comes in?


From Matt Cutts

window.onload = function(){

  var child = document.getElementById('child-iframe-id');
  child.style.height = child.contentWindow.document.body.scrollHeight + 'px';

}

NOTE: If your child content window comes from a different domain as the parent, this likely won't work correctly, or reliably.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜