Needs review
Project:
OM Maximenu
Version:
7.x-1.43
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Mar 2012 at 23:19 UTC
Updated:
5 May 2014 at 23:59 UTC
Jump to comment: Most recent
I need a css class on parent items that will allow me to style the parent item whenever its child items are open, including when the parent item is not active, and when there's no hover state on the child items. For example, if I am on the front page and I hover over the "About Us" level-one parent item, its background changes to green and its child items (second-level menu block) open. I'd like the parent item to stay green when I move the cursor off the parent item and onto the child menu block, whether to hover over a child item or not.
Is there anyway to put a class on the parent item of open child items that doesn't depend on hover or active states?
Comments
Comment #1
danielhonrade commentedIf you're using menu block, there's a checkbox in the config that says make the menu active when the submenus are active, this will cause the top level menu to have active-trail class when the menu block iten is open or active.
Comment #2
drupalusering commentedIs it possible to have an active class while .om-content is open on parent element? I am able to add css for :hover state for parent, but it won't remain active as soon as mouse leaves it and hover over .om-content
Comment #3
drupalusering commentedadding this to om_maximenu.js
Comment #4
danielhonrade commentedI think, it should be addClass instead of toggleClass, then add another function for leaving the content to remove the class
Comment #5
c3info commentedComment #6
FrancoisL commentedHello Daniel,
this seems to not working. I ticked the checkbox and no class appeared in the code. I'm on 6x version.
The java script is working but goes on the li. Is there a solution to add the class in the a href as it is in this web site? http://www.activelivingresearch.org/
Thanks
François
Comment #7
Morasta commentedUsed #5 with the current version of om-maximenu and it did the job nicely. The solution described in #1 didn't work with views blocks in my case.