• Resolved Fadli

    (@fadlibotax)


    It’s running normal in page, but not working to call the ID in menu. I check the browser console, and got this error report:

    default.min.js?ver=5.3.2:4 Uncaught TypeError: Cannot read property 'top' of undefined
        at HTMLAnchorElement.<anonymous> (default.min.js?ver=5.3.2:4)
        at HTMLDocument.dispatch (jquery.js?ver=1.12.4-wp:3)
        at HTMLDocument.r.handle (jquery.js?ver=1.12.4-wp:3)
    (anonymous)	@	default.min.js?ver=5.3.2:4
    dispatch	@	jquery.js?ver=1.12.4-wp:3

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author malihu

    (@malihu)

    There’s another script handling smooth scrolling for your menu links. This script prevents “Page scroll to id” from doing its thing.

    I don’t know where this script comes from because you have auto-optimize enabled which combines all scripts in a single js file.

    First, try this:

    Go to “Page scroll to id” settings and enable “Prevent other scripts from handling plugin’s links” option. Save changes and test your page.

    If the above doesn’t work, you’ll need to find the this script comes from (e.g. from the theme or another plugin) and see if there’s an option to disable such functionality.

    If such option doesn’t exist, then the only thing you can do is manually edit the script so it doesn’t affect your menu links. Keep in mind that each time you update the parent theme or plugin of the script, you’ll have to re-edit it.

    If this is what you need, you’ll have to disable auto-optimize and cache so we can find which script to edit. Then, we should find and change the following code, from:

    .main_menu a, .vertical_menu a, .qbutton:not(.contact_form_button

    to:

    .main_menu a:not(._mPS2id-h), .vertical_menu a, .qbutton:not(.contact_form_button

    Hope this helps

    Thread Starter Fadli

    (@fadlibotax)

    Thank you, so much helpful!

    Yes, the issue come from my themes that literally have smooth scroll features but not working at all, even after I’ve disabled your plugin, haha.

    In case you wanna check further, I’ve disabled the smooth scroll features that come from my themes, disabled all cache and minify plugin, and enabled “Prevent other scripts from handling plugin’s links (if possible)” option.

    Thank you.

    Plugin Author malihu

    (@malihu)

    No problem ??

    It seems that the theme script affecting the menu links is still present and it’s this one:

    ...themes/bridge/js/default.min.js

    It seems that a function within this script handles all menu links with a hash (e.g. #some-link). This function does not let such links work with the default browser’s behavior but instead it applies the hash in browser’s address bar via javascript.

    In other words, while the theme allows you to disable smooth scrolling, it still has its own internal function for doing what the browser does by default. This internal function prevents other scripts/plugins from handling the menu links (and thus page scrolling).

    I have no idea why this script function does this but the only way to fix this is by manually modifying default.min.js and change the code shown in my previous post.

    I hope I make sense because it’s a technical issue…

    Thread Starter Fadli

    (@fadlibotax)

    Yeah, I got it. Thank you so much for your help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘All normal, but not working in menu’ is closed to new replies.