Tagged: 

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1355307

    Hello,

    I have updated the theme to 5.0 and after that when i click on the mobile menu it creates a # in the URL and it scroll the site to the top of the page.
    How can this be? I have tried with a website with the version 4.9.2.3 and it do not create the # in the URL.

    #1355354

    Hey mvi,

    Where can we see the problem you are having?

    Best regards,
    Rikard

    #1355438

    Hi Rikard,

    Yes of course, the link are in the private content.
    On desktop i can’t click on the mobile menu after the update but on mobile when i click on the menu I get the issue as written above.

    #1355468

    Hi,

    Thank you for the update.

    The menu item Forside is anchored to #top or to the body container but for some reason, the rest of the anchor gets removed, and only the hashtag remains. Have you tried to completely remove the #top anchor from the menu item URL?

    Best regards,
    Ismael

    #1355486

    Hi Ismael,

    The menu item Forside is not the problem but i see it also create a #. It should send the visitor to the frontpage.
    it is when you click on menu it scrolls to the top and it did not do that before.

    #1355618

    Hi,

    Looks like the default mobile menu has been removed and you replaced it with a custom icon. Where did you add the script that toggles the mobile menu container or overlay?

    Best regards,
    Ismael

    #1355810

    Hi,

    In functions.php. We have had it like that in over 1,5 year. it is after the new update it is giving a issue.
    The menu stil works but it just create # after the URL and scroll to the top of the page.

    #1355920

    Hi,

    We may need to access the site and check the script so that we can test it properly. Please provide the login details in the private field.

    Best regards,
    Ismael

    #1355948

    Yes sure i have created a login for you.

    #1356075

    Hi,

    We adjusted the code in the functions.php file a bit to prevent scrolling and remove the hashtag from the URL.

    // burger menu trigger
    function ava_trigger_burger_menu(){ ?>
        <script>
        (function($){
    		$('.open-burger-menu').on('click', function(e) {
    			$('.av-burger-menu-main a').click(); 
    			$('html, body').animate({ scrollTop: $(window).scrollTop()}, 100);
    			
    			setTimeout(function() { 
    				history.pushState("", document.title, window.location.pathname + window.location.search);
    			}, 100);
    		});
        })(jQuery);
        </script>
    <?php }
    add_action('wp_footer', 'ava_trigger_burger_menu');
    

    Best regards,
    Ismael

    #1356095

    Hi Ismael,

    Thank you for your help. So if tis happens on a different site, i can use this code to fix the issue?
    The function you changed use we on many sites, just so i know what to do when i update the rest of the sites we have.

    #1356363

    Hi,

    Yes, the script should work as long as the open-burger-menu element is present. On click, it will trigger the “.av-burger-menu-main a” element and open the burger menu, scroll to the current position, which should override the scroll issue, then remove the hashtag from the URL.

    Thank you for your patience.

    Best regards,
    Ismael

    #1356374

    Hi Ismael,

    Alright thank you for your help.
    Do you know why you had to make a new script?
    Is it because after the update the class .av-burger-menu-main have been changed?

    #1356582

    Hi,

    I am not aware of any changes in that element, the mobile menu remains the same in the later versions of the theme as far as I know. However, we do know that the hashtag occurs because the href attribute of the link element inside the av-burger-menu-main contains a hashtag.

    Best regards,
    Ismael

    #1356664

    H Ismael,

    But if we do it on 100 sites and before the update it works fine, how can it be after the update it changes?

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