PDA

View Full Version : Seeded Menu



lMattz
24-02-2005, 07:28 PM
On habbox when u click on staff it brings down some links how do i make my menu so when u click on radio it brings down the links i choose.

Please reply if u no wot i am on about.


Matt

Mentor
24-02-2005, 08:05 PM
i just Pmed on how that sort of navigtion works.
To save time ill just post teh same thing here





<script type="text/javascript">

if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
if(document.getElementById){
var el = document.getElementById(obj);
var ar = document.getElementById("masterdiv").getElementsByTagName("span");
if(el.style.display != "block"){
for (var i=0; i<ar.length; i++){

}
el.style.display = "block";
}else{
el.style.display = "none";
}
}
}

</script>


Jamm that in the header, its
Is the javascript needed. Then You need the code.

Its basicly done by a bit of dhtml. and the onclick command

put this where you wnat it to go


<div id="masterdiv">
<div class="menutitle" onclick="SwitchMenu('sub1')"> Title One</div>

<span class="submenu" id="sub1">

<a href="URL"> link </a><br>
<a href="URL"> link </a><br>

</span>

<div class="menutitle" onclick="SwitchMenu('sub2')"> Title 2 </div>
<span class="submenu" id="sub2">

<a href="URL" > link </a><br>
<a href="URL" > link </a><br>
</span>
<div>

Etc etc, you can add more lineks and sections in the same style The on onclick="SwitchMenu('sub2')"
is basily telling it wether to show or hide the links in the span tag.

Final Part to do, is the CSS

Were we define menutite and submenu
(put this in header aslo)


<style>
.menutitle{
cursor:pointer;
margin-bottom: 12px;
background-color:#EDEDED;
color:#000000;
width:95%;
padding:4px;
text-align:left;
font-weight:bold;
border:0px solid #999999;
}

.submenu{
margin-bottom: 0.5em;
text-align: left;
}
</style>

Athogh the css clours are still those from my site u can put them as anything u wnat, also its advible to ad teh normal css bits as well, to define the linsk colours etc.

hope that helps, im it was done in a bit of a hurry

iRoss
24-02-2005, 08:21 PM
I got this from dynamic drive and edited it :D

Click Here (http://www.ross.webmanage.org/Radio%20Thing/RadioExample)

Hope it kinda helps

:eusa_shif

Want to hide these adverts? Register an account for free!