-
AuthorPosts
-
December 19, 2017 at 4:30 pm #890560
i created a pair of buttons as a switch for having different Main-Menus
i first thought i will give each menu-item a unique class ( one part gets class A the other class B) onclick a button only the menu-items with class A are shown. onclick the other one it will toggle to show the other menu-items only.December 19, 2017 at 11:39 pm #890628jQuery toggle would be one solution.
December 20, 2017 at 3:57 am #890685yes i know the function – but
there are Two Buttons- the one should open parent-page of all Menu-items A – and should hide menu-items B
- the other one opens parent-page of all Menu-items B – and should hide menu-items A
I want to start by showing first Menu-items A and hide B.
So it is hard to setup the starting point – because on page load of parent-page B it will reset it again.December 20, 2017 at 7:05 am #890702I would probably create a second menu location and append it to the main menu. Either by overloading the helper-main-menu.php or using the ava_after_main_menu action hook. The second menu would represent the B items while the standard menu would show the A items. I would load the second menu hidden (css) and use a jquery script to set a cookie to indicate the currently displayed menu. Using jquery toggle I then would be able to hide the primary menu and unhide the secondary menu while setting the corresponding cookie. On page load i could use the avf_main_menu_nav filter to hide the primary menu in case the secondary menu has to be loaded in case the A/B menu items should be inherited by other pages.
December 20, 2017 at 2:53 pm #890779how does a setup for active state or current state work?
When click on a link the new page is loaded – how than can be a new class come to the active or current state.
This seem to be similar to my request.December 20, 2017 at 4:31 pm #890828With jquery you simply check $(event.target). In your case this is the button. Take the button class to be stored in the cookie. Now you can conditionally display A or B.
December 20, 2017 at 5:02 pm #890846Please do not rate my knowledge in javascript too high. – Can you explain it a bit more please!
You can see it here on a prebuild page: Link
see both buttons above the logo – but if i want to open a page (left button landing page – right button Theater Page) i do not really now how to optain it.December 20, 2017 at 5:10 pm #890853But i see now – it does not stay on that status if i click on a theaterpage
so i have to read about your $(event.target)December 20, 2017 at 5:21 pm #890859@Guenni007 would you mind to contact me directly? Talking in German might be easier and way faster than posting. We can use skype as well. You will find all my contact information on my homepage. I am happy to help one of the most valuable participants on this forum without cost (x-mas gift :-))
December 20, 2017 at 9:54 pm #890932Das ist ja nett.
ich sende dir mal die Login Daten via deinem SSL Kontaktformular zu.Du siehst dann ja – die beiden Buttons oben, die zu jeweils den Hauptseiten der Sparte führen.
Je nachdem sollen die Menupunkte Naturleben bzw. theater alle ausgeblendet werden.Danke zunächst.
-
AuthorPosts
- You must be logged in to reply to this topic.