Click to See Complete Forum and Search --> : Text/link question.


evalinece
06-27-2005, 12:10 AM
Hey guys,

I hope i'm in the right forum, but as i'm not exactly sure what the name of what i'm looking for is, I can't be sure it's even html. You know how sometimes there's a link, then you click on the link, and more links show up beneath it? Like the main link is a trigger for other links that appear when you click? I'm trying to do that, but I don't even know the technical term. If anyone could help me out, that'd be really great :)

HaganeNoKokoro
06-27-2005, 12:27 AM
Sounds like you're looking for an expanding/collapsing javascript menu. usually they go something like<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 STRICT//EN" "http://www.w3.org/TR/HTML401/strict.dtd">
<html lang="en">
<head>
<title>javascript menu</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function showHide(eid) {
var elem=document.getElementById(eid);
if(elem.style.display=="none") elem.style.display="block";
else elem.style.display="none";
return false;
}
function hideAll() {
var menus=document.getElementsByTagName("div");
for(var i=0; i<menus.length; i++) {
if(/^menu[\d]+$/.test(menus[i].id)) {
menus[i].style.display="none";
}
}
}
window.onload=hideAll;
</script>
</head>
<body>
<div>
<a href="#" onclick="return showHide('menu1');">Searches</a>
<div id="menu1" style="padding-left:20px">
<div><a href="http://www.google.ca">Google</a></div>
<div><a href="http://www.google.ca">Google</a></div>
<div><a href="http://www.google.ca">Google</a></div>
</div>
</div>
</body>
</html>

evalinece
06-27-2005, 12:56 AM
YES, that's it exactly! Thanks so much :)