使两个iframe的高度与内容自适应,且相等_javascript技巧
来源:动视网
责编:小采
时间:2020-11-27 20:33:49
使两个iframe的高度与内容自适应,且相等_javascript技巧
使两个iframe的高度与内容自适应,且相等_javascript技巧: document.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
导读使两个iframe的高度与内容自适应,且相等_javascript技巧: document.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.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.gxlcms.com" width="100%">
document.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.gxlcms.com/index_1.htm" width="100%">
jb51提醒啊,多浏览期兼容需要注意些地方,不要用document.all用兼容好的,
使两个iframe的高度与内容自适应,且相等_javascript技巧
使两个iframe的高度与内容自适应,且相等_javascript技巧: document.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