PDA

View Full Version : How to expand AND link on the submenuheader



ejb
05-26-2008, 01:17 PM
1) Script Title: Accordion Content script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu.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

Nile
05-26-2008, 08:35 PM
When you put this in for the header:


<h3 class="menuheader expandable">CSS Library</h3>

Make the h3 this:


<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.

ejb
05-28-2008, 01:29 PM
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>

Minos
05-28-2008, 03:39 PM
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.

Nile
05-28-2008, 09:27 PM
I thought that you wanted it to open in a new page. Try this:


<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>

ejb
05-29-2008, 09:44 AM
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