Menu custom link issue

Hello, I’m having menu custom link issue in this site

I made following 2 menu items with custom links

    Sobre Nós (http://restaurante.miao-sun.com#pg-8-0)
    Contacto (http://restaurante.miao-sun.com#pg-8-2)
In the front page, the navigation works fine, but when I get into another page (in this case "Ementa") and click the above menu items, it doesn't go to expected section in the front page. Can you help me to fix this? Thank you!

Please add a “/” to precede #pg-8-0 and #pg-8-2. So it will look like this:

http://restaurante.miao-sun.com/#pg-8-0
http://restaurante.miao-sun.com/#pg-8-2

Regards,
Kharis

Thank you for the reply Kharis, but it doesn’t work, the result is exactly the same as without “/”, regards.

Hello there,

Thank you for updating me. I am taking another look. I’ll let you know if can find other solution. Please be patience.

Regards,
Kharis

Hello there,

It is actually working, however as the main slide loads at the end, the target area moves down. You can check it by visiting this link: http://restaurante.miao-sun.com/#pg-8-2. On #pg-8-0, only the main slider is visible on the screen.

To prevent this situation to happen, try to do the below steps:

  1. Install and activate the TC Custom JavaScript plugin
  2. Go To Appearance > Custom JavaScript
  3. Paste the following code into the provided box

;(function($) {

  $(window).load(function () {

    var currentElem = $('#' + window.location.hash.replace('#', ''));

    if(currentElem) {
        $('html,body').animate({
          scrollTop: currentElem.offset().top
        }, 1000);
    }

  });

})(jQuery);


  1. Update

Let me know if it does anything.

Regards,
Kharis

Thank you for the help, it is working now with the custom JavaScript, just a small issue though, when I click (not from homepage) or , it indeed goes to respect sections but it also ignores the top padding (in this case 50px).

If I click the links within the homepage, it takes me to the right sections with the top padding applied, which is the expected result.

It’ll be perfect if it can be fixed, otherwise it is fine as well.

Another issue detected, with the custom JavaScript applied, it disables the mobile menu (hamburger buttom) on mobile once the page is loaded, the button only works after I scroll the page, same result in homepage or any other page.