-
AuthorPosts
-
April 14, 2016 at 12:10 pm #613737
On the one page demos, when you are at the bottom of the page or in other sections of the page, the main menu has an underline on the link, indicating where you are. Is it possible to do this with the sub-menu. Have it indicate by ID where you are in the page.
Thanks
FrankApril 14, 2016 at 12:32 pm #613765Hey frankster1234!
I did not find any submenu i think you are talking about the fullwidth submenu element ?
About Us Mission Vision Strategy Results Relax Contact
To highlight fullwidth sub menu when the page is scrolled to the linked section please do the following.
1. Add the below code in 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('a').removeClass('active-menu-item'); menu.find('a[href="#' + jQuery(this).attr('id') + '"]').addClass('active-menu-item'); } }); }); }); </script> <?php } add_action('wp_head', 'activateMenuItem');
2. Add the below CSS in Enfold > General Styling > Quick CSS
/* Your css styles for active menu item*/ .current_page_item .avia-menu-text, .active-menu-item { background:gold!important; }
Best regards,
VinayApril 18, 2016 at 5:57 pm #616715I love you guys! Great theme, great support!
April 20, 2016 at 10:56 am #618159Hi!
glad we could help. Let us know in a new ticket if you have some more questions related to the theme. We are happy to assist you.
Best regards,
Andy -
AuthorPosts
- The topic ‘Sub Menu Active Indicator’ is closed to new replies.