Disable smooth scroll

Hi,

I want to use another plugin to handle the one page navigation. But smooth scroll is blocking this.
In the page settings, i have “one page navigation” disabled. Also the plugin smooth scroll is disabled.

But the developer of the plugin “page scroll to id” said the following:

`Hi,

Your links and smooth scrolling are currently handled by another script in your theme (not “Page scroll to id”). That other script is the one adding the id hash in browser’s address bar.
Your theme’s script also prevents “Page scroll to id” from scrolling the page and doing its thing.

Since plugin’s “Prevent other scripts from handling plugin’s links” option (that you’ve enabled) can’t remove the other scripts, the only thing you can do is see if there’s an option to remove the smooth scrolling feature in your theme (you may need to contact your theme’s developer and ask them if such option exists or how you could disable it).

If there’s no such option or your theme’s developer can’t help you, you’d have to manually edit the theme’s javascript file(s) and disable it. I might be able to help you with that, but currently your theme is using minified-production js files (e.g. …themes/pro/framework/dist/js/site/x.js), so I can’t really say which function in the code to change or which exact file. `

When he told me this, the smooth scroll plugin was not even installed.

The site is http://cooperworks.be

Is there anything i’m missing, how can I make sure smooth scroll is disabled so that the other plugin can take over?

Thanks in advance.

Hi @Frederik,

Thank you for reaching out to us. Regretfully there is no option to disable the smooth scrolling feature however it can be done using custom development and it’s a bit complex.

You can turn off the smooth scrolling method with .off() method (see https://api.jquery.com/off/) and then use your code in the on() method (see https://api.jquery.com/on/). Here’s a sample code that could do what you need:

jQuery('a[href*="#"]').off('touchend click').on('touchend click', function(e) {
	e.preventDefault();
});

a[href*='#'] selector in the above code assumes all the links, you need to properly apply the selector you need to override, then turn them off() , then add your code binding through on().

Priority is also important, if your code is executed first then it will have no effect, hence, your code should be enqueued at the very last of all loaded scripts.

Here’s a related thread that could help https://theme.co/apex/forum/t/pro-gotta-scroll-problem-and-the-plugin-creator-is-not-helping/41663/2

Hope this helps!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.