Scroll effects conflicts with Elementor scrolling
-
Hi,
When installed with elementor plugin, the scrolling effects doesn’t work well. Please check the issue in this video.
The “About” and “Blog” has the ID from elementor page builder. The “Contact” has the ID coded in HTML.
It works well with “Contact” but not with others.
Can it be fixed?
-
Hello,
Check if enabling “Prevent other scripts from handling plugin’s links” option in plugin settings solves the issue.
Also check if there’s an option in Elementor to disable page scrolling.
Let me know
Hi @malihu,
I just tried that but it didn’t work for me. Sorry.
If enabling the option has no effect and there’s no setting in Elementor to disable it, you’ll have to do it manually.
Normally, the following script should exist in Elementor plugin directory:
...plugins/elementor/assets/js/frontend.min.jsIf I’m not mistaken, this script handles smooth scrolling for the Elementor plugin.
You need to edit edit frontend.min.js, find the text:
a[href*="#"]and change it to:
a[href*="#"]:not(._mPS2id-h)Save the file and test your page.
Hi @malihu
Yeah, it works this way. Thank you so much. But with that I have to edit the core file of the elementor plugin, I believe which is not advisable.
Do you think, the scrolling plugin can have a permanent solution for this in future, because elementor is becoming popular these days?
Yes it’s not advisable as you’d have to redo the changes after upgrading the Elementor plugin, but there’s no other way. In general, the problem is that smooth scrolling functionality that is added in plugins like Elementor is usually very simple without any options to disable it.
The “permanent” solution is already implemented within “Page scroll to id” and it’s the “Prevent other scripts from handling plugin’s links” option in its settings.
This option works well most of the times but not always, as it depends on how the other plugins/themes implement their smooth scrolling functionality. Elementor plugin implements this functionality in such way that “Page scroll to id” cannot remove it automatically.
“Page scroll to id” cannot alter the code of other scripts directly, so in this case, only the user can (ie you).If I find another way to do this I’ll implement it within the plugin (as a new option or by updating the current one).
Thank you so much for explaining this. I appreciate it. All the best.
Hey, no problem 🙂
I’ve just made some tests and if you can add some extra javascript in your theme/child theme, you could probably make it work without editing
frontend.min.jsdirectly.If you have time, try the following:
1. Undo the changes in
frontend.min.js.2. Disable (uncheck) “Prevent other scripts from handling plugin’s links” option in “Page scroll to id” settings.
3. Edit your theme/child theme footer.php and add the following script in a new line below
wp_footer()function (e.g. just before the closing body tag):<script> (function($){ $(window).on("load",function(){ setTimeout(function(){ var doc=$(document), $events=$("a[href*='#']").length ? $._data(doc[0],"events") : null; if($events){ for(var i=$events.click.length-1; i>=0; i--){ var handler=$events.click[i]; if(handler && handler.namespace != "mPS2id" && handler.selector === 'a[href*="#"]' ) handler.selector='a[href*="#"]:not(._mPS2id-h)'; } } },300); }); })(jQuery); </script>Save footer.php and test your page.
If the above doesn’t work you can try changing the script to:
<script> (function($){ $(window).on("load",function(){ setTimeout(function(){ var doc=$(document), $events=$("a[href*='#']").length ? $._data(doc[0],"events") : null; if($events){ for(var i=$events.click.length-1; i>=0; i--){ var handler=$events.click[i]; if(handler && handler.namespace != "mPS2id" && handler.selector === 'a[href*="#"]' ) doc.off("click",handler.handler); } } },300); }); })(jQuery); </script>Hope this helps
I appreciate any feedback 🙂Hi @malihu,
You are a superstar. The first option worked for me. Thank you so so much. You saved me. 🙂
Regards
AnjanThanks for letting me know 🙂
Help me please!
The problem is that two menu items are highlighted at once. It is necessary to highlight only one of them while scrolling through the page
how to fix: http://prntscr.com/kmi40s
site: http://makaroni.design-time.com.ua/
I use: Elementor Pro, oceanwp, Page scroll to id@palyhatata Not sure if you solved the issue(?) Please check the following FAQ:
http://manos.malihu.gr/page-scroll-to-id-for-wordpress/2/#faq-12Is there still no option to turn off the elementor-enabled smooth scroll?
I don’t have elementor on all my pages and prefer to code my own smooth scrolling, so I would love to permanently turn off Elementor smooth scrolling.
@david44pixel Check this guide:
http://manos.malihu.gr/page-scroll-to-id-elementor-guide/
You need to go to plugin settings and enable “Prevent other scripts from handling plugin’s links” option.
This seems to be plugin specific advice for “page scroll to id” plugin. I am not using this plugin.
I just want a settings option inside Elementor to disable Elementors smooth scroll to id.
@david44pixel You’re posting in “Page scroll to id” support threads, that’s why I provided a plugin level solution.
If you want support for Elementor, you should post in Elementor support forum:
https://ww.wp.xz.cn/support/plugin/elementor/
The topic ‘Scroll effects conflicts with Elementor scrolling’ is closed to new replies.