iframe在火狐下的兼容问题

FangYANYI 2011-07-21 01:00:59
 
<tr>
<td height="100%" style="border:solid 1px red;">
<iframe name="frmBody" id="frmBody" frameborder="0" marginwidth="0" marginheight="0" width="100%" height="90%" scrolling="no" style="border:solid 1px yellow;">

</iframe>
</td>
</tr>
<tr style="background-color:#3366FF;margin-top:0px;margin-bottom:2px;">
<td height="18" background="images/main/menu_bg.jpg">
<div id="tdBottom" >
<marquee direction="lef" bihavior="scroll" scrollamount="3" id="elemNoticeMessage" onmouseover="stop();" onmouseout="start();">
welcome to here
</marquee>
</div>
</td>
</tr>

上面代码在IE下没问题,在火狐和OPera下下面的那个TR显示不出来。上面这个td<td height="100%" style="border:solid 1px red;">高度不管我怎么设置都不起作用,总是占满整个浏览器
...全文
737 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
FangYANYI 2011-07-21
  • 打赏
  • 举报
回复
我发现错误原因了。是应为火狐转换后 </iframe>没有了。 var xsltProcessor = new XSLTProcessor();
xsltProcessor.importStylesheet(stylex);
var result = xsltProcessor.transformToDocument(datax);
var xmls = new XMLSerializer();
container.innerHTML = xmls.serializeToString(result);
这是我的转换代码
lsw645645645 2011-07-21
  • 打赏
  • 举报
回复
好长的代码,帮顶啦
FangYANYI 2011-07-21
  • 打赏
  • 举报
回复
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" >
<tr height="57">
<td width="100%" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/main/top_bg.jpg" width="289" height="57">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<img src="images/main/top_ll.gif" />
</td>
</tr>
</table>
</td>
<td background="images/main/top_bg.jpg">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="29" id="currentDay" style="color:#FFF;" colspan="2">

</td>
<td height="29">
<img id="weatherImg" src="images/weather/8.gif" height="29" style="margin-right:10px;margin-top:2px;" alt="天气预报"></img>
</td>
</tr>
<tr>
<td width="100%" height="28">
<div class="lable" style="color:#FFF;">
<p style="font-size:12px;">电力数据分析管理平台</p>
</div>
</td>
<td>
<div class="menu">
<ul>
<li>
<a href="" onclick="myrefresh();" target="frmBody">
<span>    刷新页面</span>
</a>
</li>
<li>
<a href="javascript:history.go(-1)">
<span>后退</span>
</a>
</li>
<li>
<a href="javascript:history.go(1)">
<span>前进</span>
</a>
</li>

<li>
<a href="#" onclick="logout();">
<span>退出</span>
</a>
</li>
</ul>
</div>
</td>
<!--<td width="18"></td>-->
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" height="25" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/main/menu_bg.jpg" width="165">
<div >
<!--class="menu_left"-->
<!--<p>-->
<label style="margin-left:5px;">当前用户:</label>
<nobr>
<span id="spanUserName" style="color:#FFF;"></span>
</nobr>
<!--</p>-->
</div>
</td>
<td background="images/main/menu_bg.jpg">
<div class="menu_list">
<ul>
<li>
<a href="#">
<!--<span>查询业务</span>-->
</a>
</li>
<li>
<a href="#">
<!--<span>出口业务</span>-->
</a>
</li>
<li>
<a href="#">
<!--<span>打印管理</span>-->
</a>
</li>
<li>
<a href="#">
<!--<span>公共管理</span>-->
</a>
</li>
<li>
<a href="#">
<!--<span>静态数据</span>-->
</a>
</li>
<li>
<a href="#">
<!--<span>收单行业务</span>-->
</a>
</li>
</ul>
</div>
</td>
</tr>
</table>

</td>
</tr>

<tr height="100%">
<td width="100%" colspan="3" height="100%">
<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
<tr height="100%">
<td width="191" height="100%" style="margin-top:0px;border:solid 3px #66CCFF;overflow:hidden;">
<div id="tdMainMenu" style="margin-top:0px;overflow-y:scroll;"></div>
</td>
<td height="100%">
<iframe name="frmBody" id="frmBody" frameborder="0" marginwidth="0" marginheight="0" width="100%" height="100%" scrolling="no">

</iframe>
</td>
</tr>
<tr style="background-color:#3366FF;margin-top:0px;margin-bottom:2px;">
<td colspan="2" height="18" background="images/main/menu_bg.jpg">
<div id="tdBottom" >
<marquee direction="lef" bihavior="scroll" scrollamount="3" id="elemNoticeMessage" onmouseover="stop();" onmouseout="start();">
welcome to here
</marquee>
</div>
</td>
</tr>
</table>
</td>
</tr>

</table>

这是转换前的代码,显示的效果没有问题
FangYANYI 2011-07-21
  • 打赏
  • 举报
回复
<localhost>

<?xml version="1.0"?>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr height="57">
<td width="100%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td background="images/main/top_bg.jpg" width="289" height="57">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<img src="images/main/top_ll.gif">
</td></tr></tbody>
</table>
</td>
<td background="images/main/top_bg.jpg">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td height="29" id="currentDay" style="color:#FFF;" colspan="2">
<td height="29"><img id="weatherImg" src="images/weather/8.gif" height="29" style="margin-right:10px;margin-top:2px;" alt="天气预报">
</td></tr><tr><td width="100%" height="28"><div class="lable" style="color:#FFF;">
<p style="font-size:12px;">电力数据分析管理平台</p></div></td><td><div class="menu"><ul>
<li><a href="" onclick="myrefresh();" target="frmBody"><span>    刷新页面</span></a></li><li><a href="javascript:history.go(-1)"><span>后退</span></a></li><li><a href="javascript:history.go(1)"><span>前进</span></a></li><li><a href="#" onclick="logout();"><span>退出</span></a></li></ul></div></td></tr></tbody></table></td></tr></tbody></table><table width="100%" height="25" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td background="images/main/menu_bg.jpg" width="165"><div><label style="margin-left:5px;">当前用户:</label><nobr><span id="spanUserName" style="color:#FFF;"></nobr></div></td><td background="images/main/menu_bg.jpg"><div class="menu_list"><ul><li><a href="#"></li><li><a href="#"></li><li><a href="#"></li><li><a href="#"></li><li><a href="#"></li><li><a href="#"></li></td></tr></tbody>
</table></td></tr>
<tr height="100%"><td width="100%" colspan="3" height="100%">
<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%"><tbody><tr height="100%">
<td width="191" height="100%" style="margin-top:0px;border:solid 3px #66CCFF;overflow:hidden;">
<div id="tdMainMenu" style="margin-top:0px;overflow-y:scroll;"></td>
<td height="100%">
<iframe name="frmBody" id="frmBody" frameborder="0" marginwidth="0" marginheight="0" width="100%" height="100%" scrolling="no">
</td></tr><tr style="background-color:#3366FF;margin-top:0px;margin-bottom:2px;"><td colspan="2" height="18" background="images/main/menu_bg.jpg"><
div id="tdBottom"><marquee direction="lef" bihavior="scroll" scrollamount="3" id="elemNoticeMessage" onmouseover="stop();" onmouseout="start();">
welcome to here
</marquee></div></td></tr></table></td></tr></table>
</td></tr></tbody></table></td></tr></tbody></table>


我用的是xsl,上面是转换后的代码,可以试试(会出现我说的效果)
挨踢直男 2011-07-21
  • 打赏
  • 举报
回复
<table>
<tr>
<td height="100%" style="border: solid 1px red;">
<iframe name="frmBody" id="frmBody" frameborder="0" marginwidth="0" marginheight="0"
width="100%" height="90%" scrolling="no" style="border: solid 1px yellow;"></iframe>
</td>
</tr>
<tr style="background-color: #3366FF; margin-top: 0px; margin-bottom: 2px;">
<td height="18" background="images/main/menu_bg.jpg">
<div id="tdBottom">
<marquee direction="lef" bihavior="scroll" scrollamount="3" id="elemNoticeMessage"
onmouseover="stop();" onmouseout="start();"> welcome to here </marquee>
</div>
</td>
</tr>
</table>

没问题啊
FangYANYI 2011-07-21
  • 打赏
  • 举报
回复
补充:我把
<iframe name="frmBody" id="frmBody" frameborder="0" marginwidth="0" marginheight="0" width="100%" height="90%" scrolling="no" style="border:solid 1px yellow;">

</iframe>
这段ifrmae代码去掉就好了。

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧