Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #576553

    Hi,

    I am trying to have the active menu element in the fullwidth submenu in color or underlined. I tried several ideas from other threats. For example this one:

    #top .av-subnav-menu > li.current-menu-item a {
    color: #78b829 !important;
    }

    and also tried without important and put it at the start of my quick CSS.

    Thanks for your Help!

    #577902

    Hi Powtin!

    Ok! we will help you with this customisation :)

    Please add the below code at the bottom of 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');
    

    Then add the below code in Enfold > General Styling > Quick CSS

    
    /* Your css styles for active menu item*/
    .active-menu-item {
     background:gold!important;
    }
    

    Regards,
    Vinay Kashyap

    #579809

    Hi,

    I tried it but it is still not working.

    It also only recognized the function when I included it in the function-enfold.php

    Thanks for your help.
    Konstantin

    #579968

    Hi!

    Please create a temporary admin login with permission to deactivate all plugins and add custom code if necessary to help you better.

    Regards,
    Vinay Kashyap

    #580300

    Hi thanks for taking a look!

    #580796

    Hey!

    We added the code at the very bottom of the functions.php file. It’s working now. Please hard refresh the page: http://www.west-aal.at/musterwohnungen/#kommunikation

    If you have the time, please create a child theme: http://kriesi.at/documentation/enfold/using-a-child-theme/

    Best regards,
    Ismael

    #585399

    Hi,
    thanks for your work! It works just fine now!

    Cheers

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘fullwidth submenu highlight active menu element’ is closed to new replies.