CMS Development

Thewalk44
Member

Website not mobile optimized - links with anchor does not work

SOLVE

Hi,

 

My name is Erik and I´ve bought a customized theme package from HubSpots partner  -The Hubguru. They don´t reply on any mails what so ever and i am in urgent need for help. 

 

My website are now finished, but when shown on mobile it does not work correctly.

I can see that the following does not work when you press the menu bar in the top right corner when using mobile phone:

 

1. Link to "fornøyde kunder = satisfied customers"

2. Link to "om oss = about us"

 

Link to website: www.thewalk.no (mobile version). 

 

The support team at HubSpot has been amazing throughout this whole process, but i have been told that the reason for this error,  is that the anchor link is working but the menu will not close. I need help to add a script that will close out the menu after someone clicks a link on it.

 

Is there someone out there that please could help me fixing these issues?

 

Best regards, 

 

Erik. 

 

0 Upvotes
2 Accepted solutions
RMR
Solution
Participant

Website not mobile optimized - links with anchor does not work

SOLVE

Hey @Thewalk44,

 

Edit your Custom/page/Moose_Theme_2017/Moose_Script.js file and paste this at the bottom, after everything else:

 

$(function() {
    $('.mainmenu a[href*="#sec"]').on('click', function() {
        $('body').removeClass('mobile-open');
        $('.mainmenu .hs-menu-wrapper').slideUp();
    });
});

Hope it works.

 

Best,

-Radu

View solution in original post

0 Upvotes
RMR
Solution
Participant

Website not mobile optimized - links with anchor does not work

SOLVE

I think you also need to add this to the CSS file (also after everything else) to prevent affecting the desktop version:

 

@media (min-width: 768px) {
    .mainmenu .hs-menu-wrapper {
        display: block !important;
        overflow: visible !important;
    }
}

View solution in original post

0 Upvotes
5 Replies 5
RMR
Solution
Participant

Website not mobile optimized - links with anchor does not work

SOLVE

Hey @Thewalk44,

 

Edit your Custom/page/Moose_Theme_2017/Moose_Script.js file and paste this at the bottom, after everything else:

 

$(function() {
    $('.mainmenu a[href*="#sec"]').on('click', function() {
        $('body').removeClass('mobile-open');
        $('.mainmenu .hs-menu-wrapper').slideUp();
    });
});

Hope it works.

 

Best,

-Radu

0 Upvotes
RMR
Solution
Participant

Website not mobile optimized - links with anchor does not work

SOLVE

I think you also need to add this to the CSS file (also after everything else) to prevent affecting the desktop version:

 

@media (min-width: 768px) {
    .mainmenu .hs-menu-wrapper {
        display: block !important;
        overflow: visible !important;
    }
}
0 Upvotes
Thewalk44
Member

Website not mobile optimized - links with anchor does not work

SOLVE

Great! Thank you so much. 

 

You saved the day 🙂

 

Best,

 

Erik. 

0 Upvotes
Thewalk44
Member

Website not mobile optimized - links with anchor does not work

SOLVE

Thanks for the effort and help, it finally works 🙂

 

Best regards,

 

Erik. 

0 Upvotes
Thewalk44
Member

Website not mobile optimized - links with anchor does not work

SOLVE

Hi,

 

Thanks man 🙂 Much appreciated! 

 

Hopefully it will work. 

 

Best, 

 

Erik. 

0 Upvotes