www.webdeveloper.com
Results 1 to 2 of 2

Thread: toggle menus

  1. #1
    Join Date
    Nov 2003
    Posts
    3

    toggle menus

    Please take a look at http://www.aba.com/community+development/default.htm

    On the left, there are two navigation buttons ... "Navigate aba.com" and "Members aba.com"

    I like the way the menus expand when you click on each navigation button ... and the menus retract when you click on the button again.

    I understand that the menus expand by loading a series of new gifs ... each gif being given a hyperlink to a different page.

    All of the code seems to be there when I "View Source."

    I thought I had isolated just the code I need to make this "toggle on and off" or "onClick" work.

    The "onClick" portion of the code seemed easy to locate ... it begins with
    <a href="page1.html" onClick="return toggleMenu('menu1')">

    But after a couple of hours of trial and error, I am unable to isolate/locate the code that makes the whole thing work.

    Would you point me in the right direction, please.

    Thanks very much.

  2. #2
    Join Date
    Sep 2003
    Location
    Portsmouth, UK Occupation: Web Developer
    Posts
    2,602
    <head>
    <SCRIPT TYPE="TEXT/JAVASCRIPT" LANGUAGE="JAVASCRIPT">
    <!-- Hide script from older browsers

    function toggleMenu(currMenu) {
    if (document.getElementById) {
    thisMenu = document.getElementById(currMenu).style
    if (thisMenu.display == "block") {
    thisMenu.display = "none"
    }
    else {
    thisMenu.display = "block"
    }
    return false
    }
    else {
    return true
    }
    }


    function secondMenu(currMenu) {
    if (document.getElementById) {
    thisMenu = document.getElementById(currMenu).style
    if (thisMenu.display == "block") {
    thisMenu.display = "none"
    }
    else {
    thisMenu.display = "block"
    }
    return false
    }
    else {
    return true
    }
    }

    // End hiding script -->
    </SCRIPT>
    </head>

    <body>
    <a href="page1.html" onClick="return toggleMenu('menu1')">
    <img border=0 src="/aba/images/ncompass/navigation/nav-navigateaba.gif" alt="Navigate ABA"></a><br>
    <span class="menu" ID="menu1">
    <a href="/About+ABA/default.htm"><img border=0 src="/aba/images/ncompass/navigation/nav-aboutaba.gif"></a><br>
    <a href="/Community+Development/default.htm"><img border=0 src="/aba/images/ncompass/navigation/nav-community.gif"></a><br>
    <a href="/Conferences+and+Education/default.htm"><img border=0 src="/aba/images/ncompass/navigation/nav-conferences.gif"></a><br>
    <a href="/Consumer+Connection/default.htm"><img border=0 src="/aba/images/ncompass/navigation/nav-consumer.gif"></a><br>
    <a href="/Industry+Issues/default.htm"><img border=0 src="/aba/images/ncompass/navigation/nav-industryissues.gif"></a><br>
    <a href="http://aba.careerbank.com/">
    <img border=0 src="/aba/images/ncompass/navigation/nav-jobbank.gif"></a><br>
    <a href="/Press+Room/default.htm"><img border=0 src="/aba/images/ncompass/navigation/nav-press.gif"></a><br>
    <a href="/Products/default.htm"><img border=0 src="/aba/images/ncompass/navigation/nav-products.gif"></a><br>
    <a href="/Sites+of+Interest/default.htm"><img border=0 src="/aba/images/ncompass/navigation/nav-sites.gif"></a><br>
    <a href="/Surveys+and+Statistics/default.htm"><img border=0 src="/aba/images/ncompass/navigation/nav-surveys.gif"></a><br>
    <a href="/Training/default.htm"><img border=0 src="/aba/images/ncompass/navigation/nav-training.gif"></a><br>
    <a href="/about+aba/aba_affiliates.htm"><img border=0 src="/aba/images/ncompass/navigation/nav-affiliates.gif"></a><br>
    <a href="http://www.aba.com"><img border=0 src="/aba/images/ncompass/navigation/left/nav-home.gif"></a><br><br>
    </span>
    </td>
    </tr>
    <tr>
    <td>
    <a href="page2.html" onClick="return toggleMenu('menu2')">
    <img border=0 src="/aba/images/ncompass/navigation/nav-membersaba.gif" alt="Members ABA"></a><br>


    <span class="menu" ID="menu2">
    <a href="page49.html" onClick="return secondMenu('menu49')"><img border=0 src="/aba/images/ncompass/navigation/nav-affiliates_centers.gif"></a><br>
    <span class="menu100" ID="menu49">
    <a href="/redirect.htm?URL=/members+only/legislative/cpc_meeting_agenda.htm" style="text-decoration:none">Card Policy Council</a><br>
    <a href="/redirect.htm?URL=/members+only/legislative/gr_rc_50902OTSsum.htm" style="text-decoration:none">Mutuality Advisory Council</a><br>
    <a href="/abasa/default.htm" style="text-decoration:none">Securities Association: ABASA</a><br>
    <a href="/abia/default.htm" style="text-decoration:none">Insurance Association: ABIA</a><br>
    <a href="http://www.baft.org" style="text-decoration:none">Foreign Trade: BAFT</a><br>
    <a href="/communitybanktax/default.htm" style="text-decoration:none"> Community Bank Tax Center</a><br>
    <a href="/community+development/default.htm" style="text-decoration:none">Community Development</a><br>
    <a href="/redirect.htm?URL=/members+only/regulatory/officialhomesite.htm" style="text-decoration:none">Securities, Trusts & Investments</a><br>
    <a href="/compliance/default.htm" style="text-decoration:none">Compliance Center</a><br>
    <a href="/redirect.htm?URL=/members+only/subs_menu.htm" style="text-decoration:none">Subchapter S Registry</a><br>
    </span>
    </body>

    thats the code you need just need to modify it now
    Richard Turner - A Virtual Insight

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles