Web Analytics Made Easy -
StatCounter dynamic menu? - CodingForum

Announcement

Collapse
No announcement yet.

dynamic menu?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • dynamic menu?

    i'm trying to build a menu system.
    pretty simple stuff, the user will click on the appropriate option (1 thru 6) and the name of that option will be highlighted and the appropriate text will display in a section below.

    any suggestions?

    I could use an i-frame here, but would prefer something more DHTML-like.
    My body's a temple... and like those ancient Greek ones it's a ruin
    sweenster.co.uk

  • #2
    oops! never mind - solved the problem.



    for anyone thats interested, i adapted a script i found:

    Code:
    <html>
    <body>
    <!--Links used to initiate the sub menus. Pass in the desired submenu index numbers (ie: 0, 1) -->
    <a href="javascript:showit(0)">option0</a> | <a href="javascript:showit(1)">option1</a> | <a href="javascript:showit(2)">option2</a><br>
    
    <!-- Edit the dimensions of the below, plus background color-->
    <ilayer width=400 height=32 name="dep1" bgColor="#E6E6FF">
    <layer name="dep2" width=400 height=32>
    </layer>
    </ilayer>
    <div id="describe" style="background-color:#E6E6FF;width:400px;height:32px"></div>
    
    
    <script language="JavaScript1.2">
    
    /*
    Tabs Menu (mouseover)- By Dynamic Drive
    For full source code and more DHTML scripts, visit [url]http://www.dynamicdrive.com[/url]
    This credit MUST stay intact for use
    
    (Modified by Sweenster 2004)
    */
    
    var submenu=new Array()
    
    //Set submenu contents. Expand as needed. For each content, make sure everything exists on ONE LINE. Otherwise, there will be JS errors.
     
    submenu[0]='content option 0 here'
    
    submenu[1]='content option 1 here'
    
    submenu[2]='content option 2 here'
    
    
    /////No need to edit beyond here
    
    var menuobj=document.getElementById? document.getElementById("describe") : document.all? document.all.describe : document.layers? document.dep1.document.dep2 : ""
    
    function showit(which){
    thecontent=(which==-1)? "" : submenu[which]
    if (document.getElementById||document.all)
    menuobj.innerHTML=thecontent
    else if (document.layers){
    menuobj.document.write(thecontent)
    menuobj.document.close()
    }
    }
    
    function contains_ns6(a, b) {
    while (b.parentNode)
    if ((b = b.parentNode) == a)
    return true;
    return false;
    }
    
    </script>
    </body>
    </html>
    My body's a temple... and like those ancient Greek ones it's a ruin
    sweenster.co.uk

    Comment

    Working...
    X