Web Analytics Made Easy -
StatCounter Menu assistance . . . - CodingForum

Announcement

Collapse
No announcement yet.

Menu assistance . . .

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

  • Menu assistance . . .

    Please reference the below link . . .

    I want to utilize this script/code, but wanted to know if there is a way that once the "link" is selected from the menu, that the respective parent and links remain open in the linked page via the navigation menu.

    Example:

    PARENT A
    link1
    link2
    link3

    PARENT B
    link1
    link2

    If link1 is selected by PARENT A menu, I want the PARENT A menu with it's respective links (1, 2 & 3) to remain open in the selected "link1" page. Understand?

    I intend on utilizing this code throughout a site, but cannot figure out how to do the said . . . ideas? help!


    http://www.codespy.com/javascriptfoldertree.html

    Thanks!
    Des

  • #2
    I can't follow the link you've provided but you would need to tie it in with an onload function.

    The only way I know of doing this would mean that the menu would have to be confiigured like this:

    function Menu(item) {
    if (item== 'Parent1') {
    open Parent1;
    }
    else if (item== 'Parent2') {
    open Parent2;
    }
    else if (item== 'Parent3') {
    open Parent3;
    }
    }

    And then in the Parent1 pages you would have an element with id="Parent1". Parent2 pages with a id="Parent2" element etc.

    The onload function would look like this:

    function PageLoad () {
    all your other onload stuff then;
    if (document.getElementById('Parent1')) {
    Menu('Parent1');
    }
    else if (document.getElementById('Parent2')) {
    Menu('Parent2');
    }
    else if (document.getElementById('Parent3')) {
    Menu('Parent3');
    }
    }
    Graeme Hackston
    New to the CF scene
    Last edited by Graeme Hackston; Jul 3, 2002, 04:25 AM.

    Comment

    Working...
    X