我研究挺长时间了.都没弄明白是怎么回事!
我呢.是用嵌入方式在一个页面中嵌入很多页面!
而这些页面都需要自动适应高度.我使用了一种自动适应高度的JS代码.
问题就来了..出现错误了..我实在没办法能解决了.求各位能帮下忙.
代码如下.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
var iframeids=["1","2","3","4","5","6"]
var iframehide="yes"
function dyniframesize(){
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById){
dyniframe[dyniframe.length] = document.getElementById(iframeids[i]);
if (dyniframe[i] && !window.opera){
dyniframe[i].style.display="block"
if (dyniframe[i].contentDocument && dyniframe[i].contentDocument.body.offsetHeight)
dyniframe[i].height = dyniframe[i].contentDocument.body.offsetHeight;
else if (dyniframe[i].Document && dyniframe[i].Document.body.scrollHeight)
dyniframe[i].height = dyniframe[i].Document.body.scrollHeight;}}
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"}}}
if (window.addEventListener)
window.addEventListener("load", dyniframesize, false)
else if (window.attachEvent)
window.attachEvent("onload", dyniframesize)
else
window.onload=dyniframesize
//-->
</script>
<title>XXXXXX</title>
<link href="/images/css.css" type="text/css" rel="stylesheet">
</head>
<body>
<TABLE width=999 border=0 align=center cellpadding=0 cellspacing=0 bordercolorlight=#AAAAFF bordercolordark=#FFFFFF style='TABLE-LAYOUT: fixed; WORD-WRAP:
break-word'>
<iframe id="1" name="1" src="XXX" scrolling=no width="999" height="0" frameborder="no" onload=dyniframesize(); onresize=dyniframesize
();></iframe>
<iframe id="2" name="2" src="XXX" scrolling=no width="999" height="0" frameborder="no" onload=dyniframesize(); onresize=dyniframesize
();></iframe>
<iframe id="3" name="3" src="XXX" scrolling=no width="999" height="0" frameborder="no" onload=dyniframesize(); onresize=dyniframesize
();></iframe>
<iframe id="4" name="4" src="XXX" scrolling=no width="999" height="0" frameborder="no" onload=dyniframesize(); onresize=dyniframesize
();></iframe>
<iframe id="5" name="5" src="XXX" scrolling=no width="999" height="0" frameborder="no" onload=dyniframesize(); onresize=dyniframesize
();></iframe>
<iframe id="6" name="6" src="XXX" scrolling=no width="999" height="0" frameborder="no" onload=dyniframesize(); onresize=dyniframesize
();></iframe>
</table>
</body>
</html>