Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1394021

    Quick question,

    On Asiamluxe.com I have a main menu link which goes to the About Us section which is lower on the same page, the home page. On the desktop it works fine, clicking it scrolls to the anchor and that part of the page. IUsing a custom link in the menu as such:

    Going to the section with the anchor ‘about’ obviously.

    However it doesn’t work on the mobile version. I wonder if this requires some coding other than the anchor?

    Thanks.

    #1394041

    Hey tonyiatridis,

    Thank you for the inquiry.

    It is not working as it should because there are two sections in the page with the same ID “about”? When the menu item is clicked, it attempts to scroll to the first element with the corresponding ID but stops immediately because the section is hidden on mobile view. Each element in the page should have a unique ID.

    Best regards,
    Ismael

    #1394444

    Oh crap I forgot we had done that. Is there any way to make it work but using a separate menu for the mobile? Or disable the about us on the mobile version perhaps? I had moved the about us to the home page because the client had so little copy for the home page.

    If neither is possible I code in a link to the bottom of the page not in the menu but near the top that say find out more about us. That I can figure out I would think.

    Thanks a bunch,

    #1394465

    Hi,
    To change the desktop version of the ID about to a different ID when the mobile menu is clicked so the mobile version of the ID about can be used for the anchor of the mobile menu try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    function change_desktop_about_id_for_mobile() { ?>
      <script>
    window.addEventListener('DOMContentLoaded', function() {
    (function($){ 
      $('.avia_mobile').on('click', '.av-burger-menu-main', function() {
        var aboutDesktop = $('#about.av-small-hide');
        $('#main').find( aboutDesktop ).prop('id', 'desktop_about');
      });
    }(jQuery));
    });
    </script>
      <?php
    }
    add_action('wp_footer', 'change_desktop_about_id_for_mobile');

    Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.

    Best regards,
    Mike

    #1394612

    Do you guys have any idea how awesome you are? That worked perfectly. I continue to amazed at the level of support I get using Enfold.

    #1394627

    Hi,

    Great, I’m glad that Mike could help you out :-)

    Please let us know if you should need any further help on the topic, or if we can close it.

    Best regards,
    Rikard

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