下面这个使两个iframe的高度与内容自适应,且相等教程由图老师小编精心推荐选出,过程简单易学超容易上手,喜欢就要赶紧get起来哦!
【 tulaoshi.com - Web开发 】
div class="TxtBox"
iframe frameborder="0" scrolling="no" name="news1" id="news1" onload="if(document.frames['news1'].document.body.scrollHeightdocument.frames['news2'].document.body.scrollHeight) document.all.news1.height=document.frames['news1'].document.body.scrollHeight;if(document.frames['news1'].document.body.scrollHeight=document.frames['news2'].document.body.scrollHeight) document.all.news1.height=document.frames['news2'].document.body.scrollHeight;" src="http://www.tulaoshi.com" width="100%"/iframe
/div
div class="TxtBox"
iframe frameborder="0" scrolling="no" name="news2" id="news2" onload="if(document.frames['news1'].document.body.scrollHeightdocument.frames['news2'].document.body.scrollHeight) document.all.news2.height=document.frames['news1'].document.body.scrollHeight;if(document.frames['news1'].document.body.scrollHeight=document.frames['news2'].document.body.scrollHeight) document.all.news2.height=document.frames['news2'].document.body.scrollHeight;" src="http://www.tulaoshi.com/index_1.htm" width="100%"/iframe
/div
图老师提醒啊,多浏览期兼容需要注意些地方,不要用document.all用兼容好的,
来源:http://www.tulaoshi.com/n/20160219/1598545.html
看过《使两个iframe的高度与内容自适应,且相等》的人还看了以下文章 更多>>