Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1347074

    Hello there,

    I have 2 topics on this page. just copncerning the mobile version.

    1. logo position on mobile
    the logo is very close to the upper screen border:
    https://josk-design.de/IMG_BC9CFEDF05E2-1.jpeg

    I inserted the following css:
    .logo img { margin-top: 40px; }
    It works for the desktop version.
    But unfortunately, it does not work for mobile.

    2. anchor links don’t work on mobile
    This appears just when I try it on my mobile phone.
    When I just scale the window on my desktop, it still works.

    Would be great if you could help me!

    BR Josephine

    #1347079

    Hey josk-design,
    Thank you for your question, for your mobile logo please try this css:

    @media only screen and (max-width: 767px) {
    .responsive #header_main .logo img, .responsive #header_main .logo svg {
        margin-top: 40px;
    }
    }

    As for your anchor links #ueber_mich and #contact you have two sections for each of these IDs so the browser wants to go to the first one but it has the display none applied. You cannot have more than one element with the same id in an HTML document.
    You actually have #ueber_mich as an ID three times on your page. Anyways this would cause an issue because there is not an easy way to change your menu anchor links based on the screen size, but I came up with a script that will change the section IDs if the html class avia_mobile is present on the burger menu click. This way the mobile menu items will work, try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    function change_duplicate_hidden_ids_on_mobile() { ?>
        <script>
    (function($){ 
    $('.avia_mobile').on('click', '.av-burger-menu-main', function() {
      var ueberMich = $('#ueber_mich.av-small-hide');
      var ueberMichtwo = $('#ueber_mich.av_two_third');
      var contact = $('#contact.av-small-hide');
      $('#main').find( ueberMich ).prop('id', 'new_ueber_mich');
      $('#main').find( ueberMichtwo ).prop('id', 'new_ueber_mich_two');
      $('#main').find( contact ).prop('id', 'new_contact');
    });
    }(jQuery));
    </script>
        <?php
    }
    add_action('wp_footer', 'change_duplicate_hidden_ids_on_mobile');

    Best regard
    Mike

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