执行顺序的问题,执行到
<iframe>的时候,两个页面应该是同时加载的,这个时候有一个块一个慢就会有时候灵,有时候不灵
写在onload事件里试试看还有没有问题
<iframe>的时候,两个页面应该是同时加载的,这个时候有一个块一个慢就会有时候灵,有时候不灵
写在onload事件里试试看还有没有问题
解决方案 »
- js导出word怎样在单元格中添加换行?
- 多重数组循环
- ajax回调函数问题【纠结】
- 高分求js验证。。。检查是否是同数字号,比如(111111,2222)
- 在一个框架页中获得另一个框架页的链接或者,关闭一个框架页,只留另一个框架页
- 访问一个页面时,弹出一个对话框,要权限验证,这个怎么可以实现?
- 探讨javascript+vml,有vml高手吗?请进....
- JS小问题,树节点的图片替换
- window.open时如何使窗口从屏幕的右下角打开!
- ★★★请教关于图层的飘动~
- 我在A.htm页面打开B.htm 然后从B.htm返回值给A.htm的listbox控件 用opener怎么不行
- 100分,求图片滚动效果!
function height()
{
window.parent.document.all.div_poll.style.height=document.body.scrollHeight;
}
</script>
<body onload="height()">
改成这样呢
<div id="div111" align="center"><IFRAME id="List" style="WIDTH: 90%" border="0" name="List" arginWidth="0" frameSpacing="0" marginHeight="0" src="pages/onlinepoll/default.aspx" frameBorder="0" noResize width="100%" scrolling="no" height="100%" vspale="0" align="middle"></IFRAME>
</div>
<script language=javascript>
document.getElementById("div111").height=List.document.body.scrollHeight;
</script>
<div id="div111" align="center"><IFRAME id="List" style="WIDTH: 90%" border="0" name="List" arginWidth="0" frameSpacing="0" marginHeight="0" src="pages/onlinepoll/default.aspx" frameBorder="0" noResize width="100%" scrolling="no" height="100%" vspale="0" align="middle"></IFRAME>
</div>
pages/onlinepoll/default.aspx中有:
<body></body>后有:
<script>
window.parent.document.all.div111.style.height=document.body.scrollHeight;
</script>
<div id="div111" align="center"><IFRAME id="List" style="WIDTH: 90%" border="0" name="List" arginWidth="0" frameSpacing="0" marginHeight="0" src="pages/onlinepoll/default.aspx" frameBorder="0" noResize width="100%" scrolling="no" height="100%" vspale="0" align="middle"></IFRAME>
</div>
pages/onlinepoll/default.aspx中有:
<body></body>后有:
<script>
window.parent.document.all.div111.style.height=document.body.scrollHeight;
</script>
var getOperaIndex = navigator.userAgent.indexOf("Opera");
var isMSIE = false;
var isOpera = false;
if (getMSIEIndex > -1)
{
isMSIE = true;
}
if (getOperaIndex > -1)
{
isOpera = true;
}var extraHeight = 32;function dyniframesize(iframename)
{
var pTar = null; if (document.getElementById)
{
pTar = document.getElementById(iframename);
}
else
{
eval('pTar = ' + iframename + ';');
} // Deal with MSIE browser.
if (isMSIE && !isOpera)
{
if (pTar.Document && pTar.Document.body.scrollHeight && pTar.Document.body.scrollWidth)
{
//ie5+ syntax
pTar.height = pTar.Document.body.scrollHeight + extraHeight;
pTar.width = pTar.Document.body.scrollWidth;
}
}
// Deal with opera browser.
else if (isOpera)
{
if (pTar.contentDocument && pTar.contentDocument.body.scrollHeight && pTar.contentDocument.body.scrollWidth)
{
//ns6 syntax
pTar.height = pTar.contentDocument.body.scrollHeight + extraHeight;
pTar.width = pTar.contentDocument.body.scrollWidth;
}
}
// Deal with mozilla or firefox browser.
else
{
if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight && pTar.contentDocument.body.offsetWidth)
{
//ns6 syntax
pTar.height = pTar.contentDocument.body.offsetHeight + extraHeight;
pTar.width = pTar.contentDocument.body.offsetWidth;
}
else
{
//ns6 syntax: because sometimes
//pTar.contentDocument.body.offsetHeight will be 0.
//So here we will set pTar.height and pTar.width with
//pTar.contentDocument.documentElement.offsetHeight
//and pTar.contentDocument.documentElement.offsetWidth
//respectively.
pTar.height = pTar.contentDocument.documentElement.offsetHeight;
pTar.width = pTar.contentDocument.documentElement.offsetWidth;
}
}
}</script>
pTar.width = pTar.Document.body.scrollWidth; // set iframe width as scrollwidth of its body document.the same to other code.