Scrolls on load, but not from menu
-
Hi,
I have an issue where the anchor works, but the smooth scrolling does not. I’ve tried everything here as per the documentation but still can’t get it to work and I’m at a loss. Any help appreciated!
The page I need help with: [log in to see the link]
-
Hello,
It seems that your theme has its own function for scrolling the page (or “Page Transition Effect” as it calls it), which prevents “Page scroll to id” from doing its thing.
The script that does this is:
https://position1.io/wp-content/themes/engage/js/engage.main.jsand the function that does this starts in line 440 (in line 446 it’s the click event that causes the issue).
I saw that you correctly enabled “Prevent other scripts from handling plugin’s links” option but it seems that it cannot remove the problematic click event automatically.
I checked your theme’s js file (engage.main.js) and the easiest way to “fix” this is to add the following class to your menu items:
magnificNormally, you should be able to add this class via the classes field in each menu item, in WordPress menu admin page.
Hope this helps
Hi, thanks for your help here, although I still cannot get it working. I tried adding the magnific class to the individual menu items (I removed the ps2id class). I then disabled the page scroll the id plugin and tried again, but not working.
Am I missing something?
Thanks,
I should point out that on page load, the scroll works. Just not when you click on a nav menu link e.g. https://position1.io/#contact
Thanks,
OK. Try another thing:
In WordPress menu admin page, click on the “Screen Options” button (at the top right corner) and check the “Link Target” option.
On your menu items, add the value
_selfin Link Target field. Save and test.This worked – thank you!!
You’re welcome 🙂
The topic ‘Scrolls on load, but not from menu’ is closed to new replies.