Responsive Dropdown Menu

Ok… So, after some poking around, I got something to work. I basically combined the menu I found here: https://webdesignerhut.com/css-dropdown-menu/ with the responsiveness of my original menu. The final code looks like… The JavaScript: <script> /* Toggle between adding and removing the “responsive” class to topnav when the user clicks on the icon */ function … Read more

How limit the width of a fixed menu-bar on scroll?

You have another div controlling the full width background. You need to alter the css of that one if you want the width to look. This css takes the background off the full width div you have and put the background on the wrap div that you have maxing at 1200px; .lifestyle-pro-blue .nav-secondary {background:none;} .wrap{background-color:rgba(0,0,0,0.5);}

Add data-track to links in menu

So there’s actually a filter for this, provided your theme doesn’t use its own menu walker class: function add_data_track_attribute( $atts, $item, $args ) { $title = apply_filters( ‘the_title’, $item->title, $item->ID ); // $title = sanitize_title($title); // if you need a slug-like title $atts[‘data-track’] = ‘navigation|click|’.$title; return $atts; } add_filter(‘nav_menu_link_attributes’, ‘add_data_track_attribute’, 10, 3); Note the commented-out … Read more

show a hidden ul if li is active

You can achieve this with a simple JQuery selector. $($(‘.active’).parent(‘ul’).get(0)).css(‘display’, ‘none’); We are selecting the parent UL where we find the active class and hiding the element via css. https://jsfiddle.net/0voxj6fp/