Results 1 to 6 of 6

Thread: How to expand AND link on the submenuheader

  1. #1
    Join Date
    May 2008
    Posts
    3
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default How to expand AND link on the submenuheader

    1) Script Title: Accordion Content script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ordionmenu.htm

    3) Describe problem: I am trying to link a page to the submenuheader. Normally it expands on click, but I would also like it to jump to a page. So expand and jump to a page. Does anybody know how to do this?

    please advice thnx
    Last edited by ejb; 05-26-2008 at 01:33 PM. Reason: retype question

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    When you put this in for the header:
    HTML Code:
    <h3 class="menuheader expandable">CSS Library</h3>
    Make the h3 this:
    HTML Code:
    <h3 class="menuheader expandable" onClick="window.open('http://google.com');">CSS Library</h3>
    If you can't figure it out on your own, replace 'http://google.com' with the link you want it to "jump" to.
    Jeremy | jfein.net

  3. The Following User Says Thank You to Nile For This Useful Post:

    ejb (05-28-2008)

  4. #3
    Join Date
    May 2008
    Posts
    3
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your reply and help Nile. I tried it but de now the link opens in a new window and i lost the hover function on the submenuheader.

    This is the code I am using with your adjustments:

    <div class="glossymenu">
    <a class="menuheader expandable" onClick="window.open('wolf_intro.php');">Wolf EnergieSpaarSystemen</a>
    <div class="submenu">
    <ul>
    <li><a href="wolf.php">Wolf</a></li>
    <li><a href="centrotec.php">Centrotec</a></li>
    </ul>
    </div>

  5. #4
    Join Date
    Dec 2004
    Posts
    177
    Thanks
    0
    Thanked 18 Times in 17 Posts

    Default

    The page where the script is located has a version that does what you are looking for, at the bottom. It is using an iFrame in addition to the menu to show content.

    The catch with that is that the menu can't be on the same page as the content you want updated. So the question is, do you have your page divided into frames? Then it would work.

    If not, there's another alternative to get the same effect:
    Let's say you have a menu with links A, B, and C. B is collapsed, and you want it to link AND expand. On the page that B takes you to, you would have the menu again, obviously. BUT, in the ddaccordion.init section of this page, you need to change the line "defaultexpanded: []" to "defaultexpanded: [index2]", where 1 refers to the collapsed button (in this example, the second).

    I don't have a test set up to verify, but that should it. Let me know if something doesn't work.
    Verzeihung!

  6. The Following User Says Thank You to Minos For This Useful Post:

    ejb (05-29-2008)

  7. #5
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    I thought that you wanted it to open in a new page. Try this:
    Code:
    <div class="glossymenu">
    <a class="menuheader expandable" onClick="window.location='wolf_intro.php';">Wolf EnergieSpaarSystemen</a>
    <div class="submenu">
    <ul>
    <li><a href="wolf.php">Wolf</a></li>
    <li><a href="centrotec.php">Centrotec</a></li>
    </ul>
    </div>
    Jeremy | jfein.net

  8. The Following User Says Thank You to Nile For This Useful Post:

    ejb (05-29-2008)

  9. #6
    Join Date
    May 2008
    Posts
    3
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks again Nile. I wil try your options and see if I can figure it out.
    By the way I am using the menu in an include file. thnx so far

Bookmarks

Posting Permissions

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