Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Hello.

    It has been a while since I have developed or even used a JavaScript expandable/collapsable menu.

    The features it needs are:
    • There will be n header links. Some header links will have some sub links and some will not.
    • The headers with sub links will expand and list the relevant sub links
    • The headers without sub links will go to the links href. (just like a normal hyperlink).
    • If I click a header which has sub links, clicking on that header again should collapse the sub links.
    • If I click a header which has sub links and then click on another header, whether that header has sub links or not the first sub links should collapse.


    Like I say I have not used these for ages, are there any standard scripts out there that I may have missed?

    Cheers

  2.  

  3. #2
    Junior Member
    Join Date
    Oct 2008
    Location
    UK
    Posts
    20
    Member #
    17637
    search google for free javascript menu ?

  4. #3
    Senior Member Shani's Avatar
    Join Date
    Nov 2004
    Posts
    1,140
    Member #
    8171
    bfsog, do you still need help with this?
    Shani

    I have an eye for detail like you'd never believe.

  5. #4
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    I have a script that covers all of my points apart from the last one, but I am not too fussed about that one.

    However this is what I now need.

    The HTML for the menu would look something like this
    HTML Code:
    <ul class="menu">
    	<li><a href="#">Books</a>
    		<ul>
    			   <li><a href="?page=book1">Book 1</a></li>
    			   <li><a href="?page=book2">Book 2</a></li>
    			   <li><a href="?page=book3">Book 3</a></li>
    		</ul>
    	</li>
    
    	<li><a href="#">Digital Products</a>
    		<ul>
    			   <li><a href="?page=dp1">Digital Product 1</a></li>
    			   <li><a href="?page=dp2">Digital Product 2</a></li>
    		</ul>
    	</li>
    </ul>
    Now, the menu works as expected.

    What I am trying to do is remember the chosen sub link. When a sub link is clicked and the page refreshes, the link that is clicked is forgotten about.

    So, I made some changes to the script and now, the link that is clicked on is remembered but all of the sub links are then displayed.

    You can view the demo here

    If you go there and click Books then click the Book 1 link you will see the Book 1 link will be bigger (to show it is remembered). But you will also see that the Digital Products sub links are then displayed. I only want the sub links of the chosen sub link to be displayed.

    I know this is because of the script I am using is set to hide all, I am not against using a different script if need be.

    Is there anyway I can only expand the sub links which get expanded (such as Books or Digital Products)?

  6. #5
    Senior Member Shani's Avatar
    Join Date
    Nov 2004
    Posts
    1,140
    Member #
    8171
    Looks like it's been resolved. Only one submenu is expanded. Good work
    Shani

    I have an eye for detail like you'd never believe.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:21 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com