-
AuthorPosts
-
June 2, 2020 at 7:06 pm #1218840
I’m trying to figure out how to adjust a small issue with the nav and anchor links. Currently as I scroll down the page through different sections/anchorlinks each of the menu items changes to highlight the color of the section I am currently on. The problem is that that color change is not triggered until the top of that section reaches the top of the browser window which is behind the nav bar. How can I offset the navigation color change to take into account the height of the header?
Thank you.
June 10, 2020 at 4:20 pm #1221256Hey D5WDesignGroup,
Thank you for the inquiry.
All anchor links are active when we checked the site regardless of where we are currently in the page and it’s because of this css code.
.header_color .av-subnav-menu a:hover, .header_color .main_menu ul:first-child > li a:hover, .header_color .main_menu ul:first-child > li.current-menu-item > a, .header_color .main_menu ul:first-child > li.active-parent-item > a, .header_color .main_menu ul:first-child > li.current_page_item > a { color: #ff9d4d; }
To override the current style, please add this css code.
.header_color .main_menu ul:first-child > li.current_page_item > a { color: #969696; } .header_color .av-subnav-menu a:hover, .header_color .main_menu ul:first-child > li a:hover, .header_color .main_menu ul:first-child > li.current-menu-item > a, .header_color .main_menu ul:first-child > li.active-parent-item > a { color: #ff9d4d; }
Now to force the active navigation to change earlier, try to add this filter in the functions.php file.
function avf_header_setting_filter_mod($header) { $header['header_scroll_offset'] = $header['header_scroll_offset'] + 48; return $header; } add_filter('avf_header_setting_filter', 'avf_header_setting_filter_mod', 9999, 1);
This will adjust the scroll-offset attribute of the main container, which value is directly used in the smoothscroll script.
Best regards,
IsmaelJune 10, 2020 at 7:08 pm #1221338Thank you Ismael. This did the trick! If you don’t mind I had posted another item last week that I really need to get resolved….
I am using the theme’s Mailchimp Signup item and if I try to change the button label to anything that has a space such as “CLICK HERE” the button label defaults to “Submit”. This happens as soon as I change the button styling from Fullwidth to 1/2. It only will use a custom label if it is one unbroken word. I need to know how to get around this issue.
Thank you for your time.
June 12, 2020 at 1:23 pm #1222037Hi,
You’re very welcome! Please continue on the next thread.
// https://kriesi.at/support/topic/mailchimp-signup-button-problem/#post-1222036
Best regards,
Ismael -
AuthorPosts
- The topic ‘Navigation current item color.’ is closed to new replies.