I
ibizara
Hello,
Does anyone know how to get the code below to work on IE.. it works
perfect on FF.
Many Thanks,
ibizara
---CODE---
<script type="text/javascript" charset="utf-8">
function toggleMe(a,b){
var e = document.getElementById(a);
for (var i = 0, containers = document.getElementsByName
("container_"+b); i < containers.length; ++i)
containers.style.display = "none";
if (!e){
return true;
}else{
e.style.display = "block";
return true;
}
}
</script>
<style type="text/css">
..subs{
margin-left: 5px;
}
</style>
<div id="container_1">
<a href="javascript:;" onclick="return toggleMe('sub_1',1)">Title 1</
a><br />
<div name="container_1" id="sub_1" style="display:none" class="subs">
Link 1-1<br />
Link 1-2<br />
Link 1-3
</div>
<a href="javascript:;" onclick="return toggleMe('sub_2',1)">Title 2</
a><br />
<div name="container_1" id="sub_2" style="display:none" class="subs">
Link 2-1<br />
Link 2-2<br />
Link 2-3
</div>
<a href="javascript:;" onclick="return toggleMe('sub_3',1)">Title 3</
a><br />
<div name="container_1" id="sub_3" style="display:none" class="subs">
<div id="container_2">
<a href="javascript:;" onclick="return toggleMe('sub_3-1',2)">Link
3-1</a><br />
<div name="container_2" id="sub_3-1" style="display:none"
class="subs">
Link 3-1-1<br />
Link 3-1-2<br />
Link 3-1-3
</div>
<a href="javascript:;" onclick="return toggleMe('sub_3-2',2)">Link
3-2</a><br />
<div name="container_2" id="sub_3-2" style="display:none"
class="subs">
<div id="container_3">
<a href="javascript:;" onclick="return toggleMe('sub_3-2-1',3)">Link
3-2-1</a><br />
<div name="container_3" id="sub_3-2-1" style="display:none"
class="subs">
Link 3-2-1-1<br />
Link 3-2-1-2<br />
Link 3-2-1-3
</div>
<a href="javascript:;" onclick="return toggleMe('sub_3-2-2',3)">Link
3-2-2</a><br />
<div name="container_3" id="sub_3-2-2" style="display:none"
class="subs">
Link 3-2-2-1<br />
Link 3-2-2-2<br />
Link 3-2-2-3
</div>
</div>
</div>
</div>
</div>
</div>
Does anyone know how to get the code below to work on IE.. it works
perfect on FF.
Many Thanks,
ibizara
---CODE---
<script type="text/javascript" charset="utf-8">
function toggleMe(a,b){
var e = document.getElementById(a);
for (var i = 0, containers = document.getElementsByName
("container_"+b); i < containers.length; ++i)
containers.style.display = "none";
if (!e){
return true;
}else{
e.style.display = "block";
return true;
}
}
</script>
<style type="text/css">
..subs{
margin-left: 5px;
}
</style>
<div id="container_1">
<a href="javascript:;" onclick="return toggleMe('sub_1',1)">Title 1</
a><br />
<div name="container_1" id="sub_1" style="display:none" class="subs">
Link 1-1<br />
Link 1-2<br />
Link 1-3
</div>
<a href="javascript:;" onclick="return toggleMe('sub_2',1)">Title 2</
a><br />
<div name="container_1" id="sub_2" style="display:none" class="subs">
Link 2-1<br />
Link 2-2<br />
Link 2-3
</div>
<a href="javascript:;" onclick="return toggleMe('sub_3',1)">Title 3</
a><br />
<div name="container_1" id="sub_3" style="display:none" class="subs">
<div id="container_2">
<a href="javascript:;" onclick="return toggleMe('sub_3-1',2)">Link
3-1</a><br />
<div name="container_2" id="sub_3-1" style="display:none"
class="subs">
Link 3-1-1<br />
Link 3-1-2<br />
Link 3-1-3
</div>
<a href="javascript:;" onclick="return toggleMe('sub_3-2',2)">Link
3-2</a><br />
<div name="container_2" id="sub_3-2" style="display:none"
class="subs">
<div id="container_3">
<a href="javascript:;" onclick="return toggleMe('sub_3-2-1',3)">Link
3-2-1</a><br />
<div name="container_3" id="sub_3-2-1" style="display:none"
class="subs">
Link 3-2-1-1<br />
Link 3-2-1-2<br />
Link 3-2-1-3
</div>
<a href="javascript:;" onclick="return toggleMe('sub_3-2-2',3)">Link
3-2-2</a><br />
<div name="container_3" id="sub_3-2-2" style="display:none"
class="subs">
Link 3-2-2-1<br />
Link 3-2-2-2<br />
Link 3-2-2-3
</div>
</div>
</div>
</div>
</div>
</div>