How should I modify it in order to let it run successfully in Netscape?
Main Topics
Browse All TopicsThe following codes work well in IE and fails in Netscape.
Could anyone help me on it?
Thanks very much for the attention.
<html>
<head>
<title>Test Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<style type="text/css">
#ie {display:block}
#ns {display:table-cell}
</style>
<script language="JavaScript">
<!--
function JsMenuBar(jsId) {
for (jsCounter=1;jsCounter<3;j
eval("item"+jsCounter).sty
}
jsId.style.display="block"
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0">
<table width="100%" cellspacing="0">
<tr>
<td width="50"> </td>
<td width="100" align="center" bgcolor="#009900" style="cursor:pointer" onclick="JsMenuBar(item1);
<td width="10"> </td>
<td width="100" align="center" bgcolor="#FF9900" style="cursor:pointer" onclick="JsMenuBar(item2);
<td> </td>
</tr>
<tr>
<td colspan="5" bgcolor="#009900" id="item1" style="display:block">Cont
<td colspan="5" bgcolor="#FF9900" id="item2" style="display:none">Conte
</tr>
</table>
</body>
</html>
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
This works in IE5 and Mozilla 1.0 (NS6+), for NS4 I have no clue (probably you should use layers):
<script language="JavaScript" type="text/javascript">
<!--
function JsMenuBar(jsId) {
for (jsCounter=1;jsCounter<3;j
//eval("item"+jsCounter).s
document.getElementById('i
}
//jsId.style.display="bloc
document.getElementById(js
}
//-->
</script>
</head>
<script language="JavaScript">
<!--
function JsMenuBar(jsId) {
for (jsCounter=1;jsCounter<3;j
//eval("item"+jsCounter).s
document.getElementById('i
}
//jsId.style.display="bloc
document.getElementById(js
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0">
<table width="100%" cellspacing="0" cellpading="0" border="0">
<tr><td>
<table><tr>
<td width="50"> </td>
<td width="100" align="center" bgcolor="#009900" style="cursor:pointer" onclick="JsMenuBar('item1'
<td width="10"> </td>
<td width="100" align="center" bgcolor="#FF9900" style="cursor:pointer" onclick="JsMenuBar('item2'
<td> </td></tr>
</table>
</td>
</tr>
<tr id="item1" style="display:block">
<td width="100%" bgcolor="#009900">Contents
</tr><tr id="item2" style="display:none">
<td width="100%" bgcolor="#FF9900">Contents
</tr>
</table>
</body>
lp, Anton
Now I see, that Mozilla couses some traubles, so there is one working example using layers. You just have to set top position of layers (in % or px). If top position of layers not know at design time, then change <div></div> to <span></span> and set left position. And make sure that you will set margins of page (different browsers use different).
And instead of 'display' is 'visibility' (NS4 use <layer> insted of <div> accessed by document.layers[...] and instead of 'hidden' is 'hide' - but never use that and neither have that browser on my system):
<script language="JavaScript">
<!--
function JsMenuBar(jsId) {
for (jsCounter=1;jsCounter<3;j
//eval("item"+jsCounter).s
document.getElementById('i
}
//jsId.style.display="bloc
document.getElementById(js
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0">
<table width="100%" cellspacing="0">
<tr><td>
<table><tr>
<td width="50"> </td>
<td width="100" align="center" bgcolor="#009900" style="cursor:pointer" onclick="JsMenuBar('item1'
<td width="10"> </td>
<td width="100" align="center" bgcolor="#FF9900" style="cursor:pointer" onclick="JsMenuBar('item2'
<td> </td></tr>
</table>
</td>
</tr>
<tr><td>
<div id="item1" style="width:100%; background-color:#009900; position:absolute; top:28px;">Contents of Tab 1</div>
<div id="item2" style="width:100%; background-color:#FF9900; position:absolute; top:28px; visibility: hidden">Contents of Tab 2</div>
</td></tr>
</table>
</body>
Business Accounts
Answer for Membership
by: mplungjanPosted on 2002-09-09 at 01:43:56ID: 7271856
It will never work in NS4.