Viewing 6 posts - 1 through 6 (of 6 total)
-
AuthorPosts
-
September 11, 2017 at 9:32 am #850392
I know that this topic has been discussed here many times but for me the right solution is not clear.
I’m using the full-sized-submenu on several pages and would love to have the element highlighted the user activates when he scrolls by.September 11, 2017 at 10:58 am #850412Hey therzig,
The solution on this thread should work: https://kriesi.at/support/topic/fullwidth-submenu-highlight-active-menu-element/#post-577902
Best regards,
NikkoSeptember 11, 2017 at 11:32 am #850423Unfortunately, no. Nothing happens.
September 11, 2017 at 9:09 pm #850669Hi therzig,
Here is the code you can put in your functions.php
//One page nav highlight function activateMenuItem(){ ?> <script> jQuery(document).scroll(function() { var sections = jQuery('.avia-section'), menu = jQuery('.av-submenu-container'), nav_height = menu.outerHeight(); jQuery(window).on('scroll', function() { var cur_pos = jQuery(this).scrollTop(); sections.each(function() { var top = jQuery(this).offset().top - 300, bottom = top + jQuery(this).outerHeight(); if (cur_pos >= top && cur_pos <= bottom) { menu.find('li.active-menu-item').toggleClass('active-menu-item'); menu.find('a[href="https://'+window.location.host+window.location.pathname+'#' + jQuery(this).attr('id') + '"]').parent("li").toggleClass('active-menu-item'); } }); }); }); </script> <?php } add_action('wp_head', 'activateMenuItem');
And the css can be any of these
.active-menu-item a * { color: red; } li.active-menu-item a, li.active-menu-item a:visited, li.active-menu-item a:active, li.active-menu-item a:hover, li.active-menu-item a:focus, #top .av-subnav-menu li a { text-decoration: none !important; } li.active-menu-item { border-bottom: 1px solid #666; }
If you need further assistance please let us know.
Best regards,
Victoria- This reply was modified 7 years, 2 months ago by Victoria.
September 12, 2017 at 3:21 pm #851042Nice. Works perfect. Thank you very mutch Victoria.
September 12, 2017 at 7:08 pm #851189Hi,
Glad that Victoria helped you. Thanks for using Enfold :)
Best regards,
Nikko -
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)
- The topic ‘highlight active menu in fullwidth submenu’ is closed to new replies.