Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #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
    Frank

    #613765

    Hey 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,
    Vinay

    #616715

    I love you guys! Great theme, great support!

    #618159

    Hi!

    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

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Sub Menu Active Indicator’ is closed to new replies.