bentheimmigrant
Forum Replies Created
-
The site is now live: http://flexprocess.co.uk/ using the accordion menu for the sidebar menu.
When you navigate to a page, you’ll see that the current page and any ancestors are opened. However, because I did it through CSS, I have to use
!importantto override the js.This also means the menu just doesn’t know it’s open, and so the + sign isn’t rotated like when you open an inactive menu.
I assume this has to be done via js, to simulate clicking the menu open on page load?
Thanks
Spoke too soon. Here is the CSS:
.wpb_category_n_menu_accordion ul li.current-menu-ancestor > ul {display: block!important;} .wpb_category_n_menu_accordion ul li.current-menu-parent > ul {display: block!important;} .wpb_category_n_menu_accordion > ul li.current-menu-item >ul {display:block!important;}This achieves the goal of opening the parent of the active link, as well as the submenu below it. However, when you click on the accordion indicator button, then menu disappears (as expected) and then reappears.
Any idea how to override the “hidden” value in the markup, but without also overriding the js?
Figured it out: I was on the right lines, but the menu has “display: hidden” written into the HTML. It needed an “!important” tag to override it.
Will do, thanks.
I also would like to have the sub menus of the active page displayed. The currently selected item class is .current-menu-item and the child class is .sub-menu, but I can’t work out how to refer to them.
.wpb_category_n_menu_accordion > ul > li.current-menu-item .sub-menu { display: block;}Doesn’t work. Any help would be appreciated.
I’m afraid this is on a local development copy, so I can’t give an address to show you.