Results 1 to 2 of 2

Thread: menu with sub menu under it

  1. #1
    Join Date
    Jan 2007
    Location
    [nl] kwadendamme
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default menu with sub menu under it

    i have made a menu based on "Modern Bricks Menu" from the dd css library


    the problem is i can't get the javascript part of what i want to work.
    assume we have this html:
    HTML Code:
    <div id="menu">
    	<div id="rootmenu">
    		<ul>
    			<li id="home"><a href="#">home</a></li>
    			<li id="test"><a href="#">test</a></li>
    
    		</ul>
    	</div>
    	<div class="submenu">
    		<div class="sub" id="home-sub">
    			<a href="#">1</a> | 
    			<a href="#">2</a> | 
    			<a href="#">3</a> | 
    		</div>
    		<div class="sub" id="test-sub">
    			<a href="#">1</a> | 
    			<a href="#">2</a> | 
    			<a href="#">3</a> | 
    		</div>
    	</div>
    </div>
    i want to do the folowing:
    on mousover-ing a <li>(or the link inside it)

    -the bar under the menu must
    change in the bar representing the submenu of that item
    (when i mouseover "home" "home-sub" changes from "hidden" to "block")
    -the color of the <li> must change in the color for that item
    -the color of the previsously selected <li> must return to black
    -the previsously open sub-div must be returned to "hidden"

    now i heve the following code (some parts are dutch):
    Code:
    function uitklappen(welke, color)
    {
    document.getElementById("home").style.background = "black";
    document.getElementById("videoportal").style.background = "black";
    document.getElementById("gallery").style.background = "black";
    document.getElementById("members").style.background = "black";
    document.getElementById("klap_home").style.display = "none";
    document.getElementById("klap_videoportal").style.display = "none";
    document.getElementById("klap_gallery").style.display = "none";
    document.getElementById("klap_members").style.display = "none";
    var deze = document.getElementById("klap_"+welke);
    var rootmen = document.getElementById(welke);
    welke.style.background = color;
    
    }
    where the klap_ are the ids of the "underbar"

    it works but the problem is that every time the function is called it must first reset all the elements background or display.

    so my (simple) question is,
    is there a simple way to scan all the li/div -s and change their states inside the menu div?

    or must i try a different approch?

    Jurgen

  2. #2
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Ah yes, the good 'ol modern brick menu. Fantastic menu, but i also desperately need a sub menus drop down for it. I don;t know coding that well to be able to help you sorry.

    thanks anyway for it, Ryan.

Bookmarks

Posting Permissions

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