Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 8 of 8

Thread: Layout help

  1. #1
    Join Date
    May 2005
    Location
    England
    Posts
    8,662
    Tokens
    0

    Latest Awards:

    Default Layout help

    Right sorry if I sound like I'm being a n00b but here it is. You know on some layouts on websites on the nav you have like say for example 'Entertainment' then you click on it and a drop down menu of say 'Games' 'Music' comes on. Right well I have a layout already coded in expandable tables and was wondering how//if I could add these 'dropdowns' seeing as I don't have any yet on my template. Sorry its confusing. +Rep for help

    Craig

  2. #2
    Join Date
    Aug 2004
    Location
    bristol
    Posts
    3,799
    Tokens
    0

    Latest Awards:

    Default

    I made one and posted it ages ago for someone, let me find it.
    Edit:
    Can't find it. Anyway, it's JavaScript and you just need to add an onClick atribute.

    Something like:
    HTML Code:
    <a href="#" onClick="document.getElementById('blah').style.display='block'">Link</a>
    <div id="blah" style="display:none">
    <li>Link</li>
    <li>Link</li>
    <li>Link</li>
    <li>Link</li>
    </div>
    Last edited by nets; 20-03-2006 at 05:35 PM.
    kinda quit.

  3. #3
    Join Date
    May 2005
    Location
    England
    Posts
    8,662
    Tokens
    0

    Latest Awards:

    Default

    Thanks =]

  4. #4
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    Lol you pmed me about this. Where on my site do I have javascript naviagation?

  5. #5
    Join Date
    Dec 2004
    Posts
    7,327
    Tokens
    1,276
    Habbo
    ---MAD---

    Latest Awards:

    Default

    you can also search on google.co.uk for drop down menus and youll find some there .
    ---MAD---

  6. #6
    Join Date
    May 2005
    Location
    England
    Posts
    8,662
    Tokens
    0

    Latest Awards:

    Default

    I thought you did Tom.

    Thanks Nets and Mad

    Would this be it by anychance?

    Quote Originally Posted by Javascript Code
    <script type="text/javascript">

    /***********************************************
    * Switch Menu script- by Martial B of http://getElementById.com/
    * Modified by Dynamic Drive for format & NS4/IE4 compatibility
    * Visit http://www.dynamicdrive.com/ for full source code
    ***********************************************/

    var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
    var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only

    if (document.getElementById){ //DynamicDrive.com change
    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").getElementsBy TagName("span"); //DynamicDrive.com change
    if(el.style.display != "block"){ //DynamicDrive.com change
    for (var i=0; i<ar.length; i++){
    if (ar[i].className=="submenu") //DynamicDrive.com change
    ar[i].style.display = "none";
    }
    el.style.display = "block";
    }else{
    el.style.display = "none";
    }
    }
    }

    function get_cookie(Name) {
    var search = Name + "="
    var returnvalue = "";
    if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) {
    offset += search.length
    end = document.cookie.indexOf(";", offset);
    if (end == -1) end = document.cookie.length;
    returnvalue=unescape(document.cookie.substring(off set, end))
    }
    }
    return returnvalue;
    }

    function onloadfunction(){
    if (persistmenu=="yes"){
    var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
    var cookievalue=get_cookie(cookiename)
    if (cookievalue!="")
    document.getElementById(cookievalue).style.display ="block"
    }
    }

    function savemenustate(){
    var inc=1, blockid=""
    while (document.getElementById("sub"+inc)){
    if (document.getElementById("sub"+inc).style.display= ="block"){
    blockid="sub"+inc
    break
    }
    inc++
    }
    var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
    var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
    document.cookie=cookiename+"="+cookievalue
    }

    if (window.addEventListener)
    window.addEventListener("load", onloadfunction, false)
    else if (window.attachEvent)
    window.attachEvent("onload", onloadfunction)
    else if (document.getElementById)
    window.onload=onloadfunction

    if (persistmenu=="yes" && document.getElementById)
    window.onunload=savemenustate

    </script>
    </head>

    <!-- Keep all menus within masterdiv-->
    <div id="masterdiv">
    <font face="Verdana" size="1" color="#000000">



    <div class="menutitle" onclick="SwitchMenu('sub2')"><img src="THE THING YOU CLIKC ON"></div>
    <span class="submenu" id="sub2">
    - LINK<br>
    - LINK<br>
    - LINK<br>
    - LINK<br>
    - LNIK<br>
    - LNIK<br>
    </span>





    <div class="menutitle" onclick="SwitchMenu('sub3')"><img src="THE THING YOU CLIKC ON"></div>
    <span class="submenu" id="sub3">
    - LINK<br>
    - LINK<br>
    - LINK<br>
    - LNIK<br>
    - LINK<br>
    </span>






    <div class="menutitle" onclick="SwitchMenu('sub4')"><img src="THE THING YOU CLIKC ON"></div>
    <span class="submenu" id="sub4">
    - LINK<br>
    - LINK<br>
    - LINK<br>
    - LNIK<br>
    - LINK<br>
    </span>






    <div class="menutitle" onclick="SwitchMenu('sub5')"><img src="THE THING YOU CLIKC ON"></div>
    <span class="submenu" id="sub5">
    - LINK<br>
    - LINK<br>
    - LINK<br>
    - LNIK<br>
    - LINK<br>
    </span>






    <div class="menutitle" onclick="SwitchMenu('sub6')"><img src="THE THING YOU CLIKC ON"></div>
    <span class="submenu" id="sub6">
    - LINK<br>
    - LINK<br>
    - LINK<br>
    - LNIK<br>
    - LINK<br>
    </span>






    <div class="menutitle" onclick="SwitchMenu('sub7')"><img src="THE THING YOU CLIKC ON"></div>
    <span class="submenu" id="sub7">
    - LINK<br>
    - LINK<br>
    - LINK<br>
    - LNIK<br>
    - LINK<br>
    </span>





    <div class="menutitle" onclick="SwitchMenu('sub8')"><img src="THE THING YOU CLIKC ON"></div>
    <span class="submenu" id="sub8">
    - LINK<br>
    - LINK<br>
    - LINK<br>
    - LNIK<br>
    - LINK<br>
    </span>



    <div class="menutitle" onclick="SwitchMenu('sub9')"><img src="THE THING YOU CLIKC ON"></div>
    <span class="submenu" id="sub9">
    - LINK<br>
    - LINK<br>
    - LINK<br>
    - LNIK<br>
    - LINK<br>
    </span>




    <div class="menutitle" onclick="SwitchMenu('sub10')"><img src="THE THING YOU CLIKC ON"></div>
    <span class="submenu" id="sub10">
    - LINK<br>
    - LINK<br>
    - LINK<br>
    - LNIK<br>
    - LINK<br>
    </span>


    <div class="menutitle" onclick="SwitchMenu('sub11')"><img src="THE THING YOU CLIKC ON"></div>
    <span class="submenu" id="sub11">
    - LINK<br>
    - LINK<br>
    - LINK<br>
    - LNIK<br>
    - LINK<br>
    </span>

    </div>

  7. #7
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    Looks like one.

  8. #8
    Join Date
    Aug 2004
    Location
    bristol
    Posts
    3,799
    Tokens
    0

    Latest Awards:

    Default

    That's taking it a bit too far, it only needs a simple script.
    kinda quit.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •