...

View Full Version : Expandable list not working in NN



chelvis
01-27-2004, 06:54 PM
Here is a code for expandable list. This is not working in NN 4.7.

Is there a way I can modify so it will work in NN 4.7?

<head>
<style type="text/css">
<!--
.open {
display: block;
}
.closed {
display: none;
}
li {
list-style-type: none;
padding-top: .2em;
padding-bottom: .2em;
font-size: 18px;
}
-->
</style>

<script type="text/javascript">
<!--
function toggle(id){
ul = "ul_" + id;
img = "img_" + id;
ulElement = document.getElementById(ul);
imgElement = document.getElementById(img);
if (ulElement){
if (ulElement.className == 'closed'){
ulElement.className = "open";
imgElement.src = "images/opened.gif";
}else{
ulElement.className = "closed";
imgElement.src = "images/closed.gif";
}
}
}
//-->
</script>
</head>

<body>

<table>
<tr><td valign="top">




<ul class="open">
<li id="item1"><a href="#" onclick="toggle('item1');"><img src="images/closed.gif" alt="" id="img_item1" border="0"></a> <a CLASS="LgBLueLink" href="#">Introduction: Dimensional Analysis: Similitude</a>
<ul id="ul_item1" class="closed">
<li id="item1_1"><img src="images/wh.gif"> <a CLASS="LgBlueLink" href="#">Introduction</a></li>
<li id="item1_2"><img src="images/wh.gif"> <a CLASS="LgBlueLink" href="#">The Equation of Contiuity</a></li>
<li id="item1_3"><img src="images/wh.gif"> <a CLASS="LgBlueLink" href="#">The First Law of Thermodynamics</a></li>
<li id="item2"><a href="#" onclick="toggle('item2');"><img src="images/closed.gif" alt="" id="img_item2" border="0"></a> <a CLASS="LgBLueLink" href="#">Introduction: Dimensional Analysis: Similitude</a>
<ul id="ul_item2" class="closed">
<li id="item1_41"><img src="images/wh.gif"> <a CLASS="LgBlueLink" href="#">Introduction</a></li>
<li id="item1_42"><img src="images/wh.gif"> <a CLASS="LgBlueLink" href="#">The Equation of Contiuity</a></li>
<li id="item1_43"><img src="images/wh.gif"> <a CLASS="LgBlueLink" href="#">The First Law of Thermodynamics</a></li>
<li id="item3"><a href="#" onclick="toggle('item3');"><img src="images/closed.gif" alt="" id="img_item3" border="0"></a> <a CLASS="LgBLueLink" href="#">Momentum Equation - The Newton's Laws</a>
<ul id="ul_item3" class="closed">
<li id="item1_41"><img src="images/wh.gif"> <a CLASS="LgBlueLink" href="#">Introduction</a></li>
<li id="item1_42"><img src="images/wh.gif"> <a CLASS="LgBlueLink" href="#">The Equation of Contiuity</a></li>
<li id="item1_43"><img src="images/wh.gif"> <a CLASS="LgBlueLink" href="#">The First Law of Thermodynamics</a></li>
</ul>

</li>
</ul>
</li>
<li id="item1_5"><img src="images/wh.gif"> <a CLASS="LgBlueLink" href="#">The Second Law of Thermodynamics</a>
<ul id="ul_item1" class="closed">
<li id="item1_1"><img src="images/wh.gif"> <a CLASS="LgBlueLink" href="#">Introduction</a></li>
<li id="item1_2"><img src="images/wh.gif"> <a CLASS="LgBlueLink" href="#">The Equation of Contiuity</a></li>
<li id="item1_3"><img src="images/wh.gif"> <a CLASS="LgBlueLink" href="#">The First Law of Thermodynamics</a></li>
<li id="item2"><a href="#" onclick="toggle('item2');"><img src="images/closed.gif" alt="" id="img_item2" border="0"></a> <a CLASS="LgBLueLink" href="#">Introduction: Dimensional Analysis: Similitude</a>
<ul id="ul_item2" class="closed">
<li id="item1_41"><img src="images/wh.gif"> <a CLASS="LgBlueLink" href="#">Introduction</a></li>
<li id="item1_42"><img src="images/wh.gif"> <a CLASS="LgBlueLink" href="#">The Equation of Contiuity</a></li>
<li id="item1_43"><img src="images/wh.gif"> <a CLASS="LgBlueLink" href="#">The First Law of Thermodynamics</a></li>
<li id="item3"><a href="#" onclick="toggle('item3');"><img src="images/closed.gif" alt="" id="img_item3" border="0"></a> <a CLASS="LgBLueLink" href="#">Momentum Equation - The Newton's Laws</a>
<ul id="ul_item3" class="closed">
<li id="item1_41"><img src="images/wh.gif"> <a CLASS="LgBlueLink" href="#">Introduction</a></li>
<li id="item1_42"><img src="images/wh.gif"> <a CLASS="LgBlueLink" href="#">The Equation of Contiuity</a></li>
<li id="item1_43"><img src="images/wh.gif"> <a CLASS="LgBlueLink" href="#">The First Law of Thermodynamics</a></li>
</ul>

</li>
</ul>




</li>
<li id="item1_6"><a CLASS="LgBlueLink" href="#">The Third Law of Thermodynamics</a></li>
<li id="item1_7"><a CLASS="LgBlueLink" href="#">The Momentum Equation - Newtons Laws</a></li>
</ul>
</li>

</ul>




</td></tr>
</table>
</body>

Roy Sinclair
01-27-2004, 07:28 PM
No, you cannot fix it for Netscape 4.x because Netscape 4.x predates so many of today's standards and lacks true dynamic capabilities. Treat Netscape 4.x like you would Netscape 3.x or IE 3.x.

chelvis
01-27-2004, 07:37 PM
ok thanks. Does any one know of a javascript or dhtml for this kind of menu (collapsible expandable or nested menu) which will work in NN 4.7 also?

brothercake
01-27-2004, 11:13 PM
It's not possible without tag-soup coding written last century which would invalidate your page in every other browser, and almost certainly not work in modern mozilla browsers, Safari or Opera.

But if you really want that ... Dan Steinman's original DynAPI might have something.

Caffeine
01-28-2004, 07:58 AM
Before you decide if you really want to code for NS 4.x I urge you to read these articles @ a list apart:
http://www.codingforums.com/images/icons/icon2.gif To Hell With Bad Browsers (http://www.alistapart.com/articles/tohell/)
http://www.codingforums.com/images/icons/icon2.gif Why Donít You Code for Netscape? (http://www.alistapart.com/articles/netscape/)

It convinced me not to code for NS 4.x anymore [or for any specific browser for that matter], the benefits of coding according to the standards are far superior to coding for individual browsers !

Not sure if this helps you or not, but the articles helped me convincing my boss that the NS 4.x and IE <5 are bad bad bad :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum