Accordion Menu / Posts /

Give parent item a page link

2
I've just purchased the accordion menu and it works well BUT I have a parent items that open up child items and I also want them to open a new page on click. This will work but I find that on load those items with a link also show all of their child items ... I only want the parent items to be shown on page load (unless the page is for a child item). i.e if I remove the link from <li id="v_hm"><a href="http://www.XXX.html">Parent Page</a> the menu is as it should be with this link in, all of the child items of all of those parents with links are shown.
Hope that makes sense! Is it possible to stop this as I really need the parent to link to a page in some cases. 
Thanks
Ali  11 years ago   viewed: 4596    

8 Answers

0
If children of the parent link are hidden, there will be no chance for them to show up. I wonder why you add them as the link's children then?

Have you also tried the built-in open and close functionality?
Milo   11 years ago
0
Hi milo 
Not sure I've explained properly. Take a looks tmthis page I've been working on: 
Http://www.pigeoncontrolresourcecentre.org/html/site-mapTEST.html
You ll see the pigeon control control product reviews parent opens to have various items, but on click I wanted the pigeon control product reviews page to show as well as the drop down to open up. Hopefully that makes more sense?
Thanks!
Ali   11 years ago
0
I believe you have read the section about how to use our built-in amenu.open() function.

Then you can add a dummy link as one of the children under "Pigeon Control Product Reviews", but make it invisible:
<li id="Li99" style="display:none;"><a href="(path of an unexisting page)">dummy</a></li>

Note you need to replace the above (path of an unexisting page) with something like "/html/notexist.html" that looks real, but it is actually not existing.

And in your "Pigeon Control Product Reviews" page, add the following script at the end of your page, just before the </body>:
<script>
amenu.open("Li99", true);
</script>

I didn't test it out. Please post your result to let us know if it works. Thanks.

Milo
  11 years ago
0
hi milo
it works! thank you so much! i removed the display:none though as it removed it altogether. i'm having problems though as i have multiple parent items that i want linking and the internal pages seem to open up all items in the menu. i've had a try and making the amenu.open to be false but that doesn't seem to make any difference. maybe i'm not putting it in the correct place. i've named the li items 99, 89 and 79 so when 99 is open i want 89 and 79 to be closed but at the moment they're open. probably something simple but i can't quite fathom where it should go ... any pointers appreciated!
ali   11 years ago
0
aaaah think i've just worked out why ... need to add the script code into the child pages too ..
ali   11 years ago
0
hi again
sorry just come across a problem; if you look here: http://www.pigeoncontrolresourcecentre.org/html/cleaning-pigeon-droppings.html you'll see the parent items are open but i want them closed. i added in <script>
amenu.open("Li89", false);
</script> to test out closing one but it doesn't work. should that go somewhere else? thanks!
ali   11 years ago
0
sorry i see where the display:none bit goes now; it's a dummy so that I can use that on the other pages so that the menu is closed. works now :-)
ali   11 years ago
0
Ps the link above is not using the menu cool menu, it's one I was working on but does show what I mean. If I add a link to the product reviews parent item, when a page is opened the whole of the sub menu that should be hidden shows in the menu cool version. If this doesn't make sense I ll load to the server and give you the link.
Ali   11 years ago

   

Your name*
Password
(Optional. Used to modify this post afterwords)
+ =  

Ask your Own Question

  • If your question is related to the topic of this post, you can post your question to this page by clicking the "Post a reply" button at left;

  • When you want to start a new page for your question: