Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1359862

    When using an anchor-link on the one-pager and scroll back to the top the logo on header didn’t resize to the correct size (only a bit bigger), but after changing to size of the browser-window it does.

    Also the active marker in menu jumps first to the second link and thats wrong (I did checked all ID’s but didn’t found any mistake of mine).

    Can somebody help me with that problems? Thanks.

    #1359863

    If I use an anchor link and then srcoll up to the menu, the logo size doesn’t correct resize, it just gets a little bigger (to about 60% of the height). After resizing the browser window, it immediately jumps to the correct size.

    Also the marking of the active menu item is not correct. It starts with the second item and then jumps to the first. I have checked all the IDs, but I can’t find any mistakes there.

    Any solutions for that? THANKS.

    #1359967

    Hi,
    Thanks for your question and the link to your site, for your logo this css should help:

    @media only screen and (min-width: 768px) {
    .av_header_transparency #header_main svg {
        height: 200px !important;
        max-height: 200px !important;
    }
    }

    but I notice that your main menu height is also not correct, perhaps you have tried to change the header height with some custom css instead of using the theme options at Enfold Theme Options ▸ Header ▸ Header Layout ▸ Header Size?
    Perhaps it would be better to remove your custom css and try the theme option.
    As for your main menu links, it seems like your page is reloading instead of jumping down to the anchor, in your menu items did you place the whole url, try just using the anchor ID.
    If this doesn’t help please include an admin login in the Private Content area so we can be of more assistance.

    Best regards,
    Mike

    #1359989

    Hello.
    The code worked great. But even better was the tip about the theme option. Thank you. That works great.

    Unfortunately I have to use absolute paths in the menu, because the imprint and privacy are separate pages. But for test purposes I tried the links only with the anchor IDs – unfortunately with the same result: A wrong active menu item is displayed first.

    #1360492

    Hi,
    Thank you for your patience, I found that the two sub-menu items #einfamilienhaeuser & #wohnanlage are triggering as the active menu item when the #informationen section is in view, I created a test menu without these two items and the menu works correctly, please try enabling the test menu to test.
    I checked your page but couldn’t find duplicates for #einfamilienhaeuser & #wohnanlage, so I’m not sure what could be causing this.
    You could try this javascript solution to correct the highlighting based on the scroll, try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    function custom_script() { ?>
      <script>
    (function ($) { 
    	setTimeout(function(){
    	$("#menu-item-762").removeClass('current-menu-item');
    	},300);
      $(window).scroll(function() {    
          var scroll = $(window).scrollTop();
          if (scroll > 500) {
              $("#menu-item-783").addClass('current-menu-item');
          } else {}
          if (scroll < 1400) {
              $("#menu-item-762").removeClass('current-menu-item');
          } else {}
          if (scroll > 1400) {
              $("#menu-item-783").removeClass('current-menu-item');
          } else {}
      });
    })(jQuery);
    </script>
      <?php
    }
    add_action('wp_footer', 'custom_script');

    and see if this helps

    Best regards,
    Mike

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.