Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    cascading side menu links

    Hi there,

    below is the html for 1 page of a 3 page test site i've created with an expanding side menu that I need... I've linked this html to an external javascript .js (that code I have attached as a .txt to this thread).

    what I'm trying to do is get a menu where the 3 folders that link to page1.htm, page2.htm and page3.htm also expand it's child menu items when the link is clicked.. (do you follow? basically when a new page is opened from the side menu link, the side menu links' children menu items also expand,, and the javascript assigns a cookie to handle this).

    Now the code I have used achieves this to a certain extent.. however my problem is that if the menu items are expanded, and the link is clicked again, the page opens again, but the expanded child menu items contract again. Ineed to slightly modify the javascript code so that when page2.htm is opened for example, the children of folder1 and folder3 contract automatically... or if page3.htm gets opened, folder1 and folder2 contract and only the child nodes of the respective page stay open.

    Below is what is contained in the body tags of page1.htm.. page2.htm and page3.htm all have the menu so they contain exactly the same html (except it says this is page2 or 3 in the title.

    I haven't included the head tags html, as all that contains is the source for the external .js file.

    the attached .txt is the complete .js file powering the menu so you can see what I've done,,, just download and resave as a .js

    Any help would be much appreciated ... even just a pointer in the right directions (ie what function i need to edit) would help.. anymore would be a bonus!

    Code:
    <h1><strong>This is page 1</strong></h1>
    <p><a href="javascript:ddtreemenu.flatten('treemenu1', 'expand')">Expand All</a> | <a href="javascript:ddtreemenu.flatten('treemenu1', 'contact')">Collapse All</a>
        
    </p>
    <ul id="treemenu1" class="treeview">
    <li>Item 1</li>
    <li>Item 2</li>
    
    <li><a href="page1.htm">Folder 1</a>
    	<ul>
    	<li>Sub Item 1.1</li>
    	<li>Sub Item 1.2</li>
    	</ul>
    </li>
    <li>Item 3</li>
    
    <li><a href="page2.htm">Folder 2</a>
    	<ul>
    	<li>Sub Item 2.1</li>
    	<li>Folder 2.1
    		<ul>
    		<li>Sub Item 2.1.1</li>
    		<li>Sub Item 2.1.2</li>
    		</ul>
    	</li>
    </ul>
    </li>
    
    <li><a href="page3.htm">Folder 3</a>
    	<ul>
    	<li>Sub Item 3.1</li>
    	<li>Folder 3.1
    		<ul>
    		<li>Sub Item 3.1.1</li>
    		<li>Sub Item 3.1.2</li>
    		</ul>
    	</li>
    </ul>
    </li>
    
    <li>Item 4</li>
    </ul>
    Attached Files Attached Files

  • #2
    New to the CF scene
    Join Date
    Oct 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    fixed

    hey there, i managed to fix this menu.


  •  

    Posting Permissions

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