菜单显示页,代码如下:
<html>
<head>
<title>display</title>
<script type="text/javascript">
<!--
function show(id){
var msg=document.getElementById("submenu"+id);
if(msg.style.display=="none")
msg.style.display="block";
else
msg.style.display="none";
}
//-->
</script>
</head>
<body>
<table width="100%" >
<tr width="100%">
<td width="100%">
<font style="cursor:hand;" onclick="show(1)">
菜单一
</font>
</td>
</tr>
<tr id="submenu1" style="display:none;">
<td>
<table>
<tr>
<td>子菜单a</td>
</tr>
<tr>
<td>子菜单b</td>
</tr>
</table>
</td>
</tr>
<tr width="100%">
<td width="100%">
<font style="cursor:hand;" onclick="show(2)">
菜单二
</font>
</td>
</tr>
<tr id="submenu2" style="display:none;">
<td>
<table>
<tr>
<td>子菜单c</td>
</tr>
<tr>
<td>子菜单d</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
<html>
问题:
在Firefox中执行后"display:none;"没有回收"display:block;"开辟的页面空间,
下次再执行"display:block;"又会在页面上重新创建显示空间。
原因:
The reason it "appears" to work with IE is probably because IE is
error-correcting the display property for you.As others have implied,
IE has no concept of the table-row value. In fact,Microsoft's documentation
(<URL:http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/display.asp>)
clearly states that all block-like elements (with a few exceptions) have
'block' as their display value, contrary to specification.
解决:
将代码
msg.style.display="block";
修改为
msg.style.display="";
分享到:
相关推荐
org.mozilla.javascript
解压后可用,资源全名:Firefox 52.4.0esr.dmg
解压后可用,资源全名:Firefox Setup 68.5.0esr.exe
Mozilla Firefox 64位_56.0.2.6506 Mozilla Firefox 64位_56.0.2.6506
Mozilla Firefox火狐浏览器介绍.docx
资源全名:Firefox 52.8.1esr.dmg
jar包,官方版本,自测可用
这个软件包括了火狐...包括如下版本:Mozilla Firefox 2.0.0.20Mozilla Firefox 3.0.19.0Mozilla Firefox 3.5.19.0Mozilla Firefox 3.6.18.0Mozilla Firefox 4.0.1.0Mozilla Firefox 5.0.0.0Mozilla Firefox 6.0.0.0
org.mozilla.javascript-1.7.2.jar资源包
Mozilla FireFox V2Mozilla FireFox V2Mozilla FireFox V2
解压后可用,资源全名:Firefox Setup 52.2.0esr.exe
Mozilla Firefox 56.0.2 正式版发布Mozilla Firefox 56.0.2 正式版发布
Mozilla Firefox_18.0.2.rar 超好用的火狐版本,几年来,从搜狗、360,再到谷歌火狐,各种浏览器的不少版本都用过了,最终还是喜欢这个版本。 而且性能表现不错!20个页面才占用630M内存,15%CPU,而且一点卡顿的...
self.headers = {"User-Agent":"Mozilla/5.0"} self.conn = pymongo.MongoClient("localhost",27017) self.db = self.conn.Baikedb self.myset = self.db.baikeset def getPage(self): res = requests.get...
Mozilla Firefox火狐浏览器
Mozilla Firefox,通称Firefox,中文也通称火狐,是一个自由及开源的网页浏览器[14],由Mozilla基金会及其子公司Mozilla公司开发。Firefox支持Windows、macOS及Linux,其移动版支持Android及Firefox OS,这些版本的...
Mozilla Firefox.rar
Mozilla Firefox,中文俗称“火狐”(正式缩写为Fx或fx,非正式缩写为MF),是一个自由及开放源代码的网页浏览器,使用Gecko排版引擎,支持多种操作系统,如Windows、Mac OS X及GNU/Linux等。该浏览器提供了两种版本...
火狐浏览器(Mozilla Firefox)是一个自由的,开放源码的浏览器,适用于 Windows, Linux 和 MacOS X平台。火狐浏览器体积小速度快,还有其它一些高级特征。火狐浏览器(Mozilla Firefox)主要特性有:标签式浏览,使上网...
=undefined) { // mozilla(firefox) url = window.URL.createObjectURL(file) ; } else if (window.webkitURL!=undefined) { // webkit or chrome url = window.webkitURL.createObjectURL(file) ; } return ...