Plugin Author
malihu
(@malihu)
Hi,
I’m guessing this happened after updating DIVI theme(?)
There’s a DIVI script which prevents “Page scroll to id” from working. The script is this one:
...themes/Divi/js/custom.unified.js
First, try to see if there’s a DIVI option to disable its smooth scrolling feature.
You can also try going to “Page scroll to id” settings and set the “Prevent other scripts from handling plugin’s links selector(s)” option field value to:
a[href*='#']:not([href='#'])
Save changes, test and let me know
I unchecked smooth scrolling, added that field to the plugin settings and reset the cache. Looks like the problem is persisting.
Plugin Author
malihu
(@malihu)
Seems like the only solution is to add an extra custom script in your page. Can you do this? If yes, I’ll test and post a script (should be a 2-3 lines of code).
Plugin Author
malihu
(@malihu)
OK. Add the js script below in your template. A good place is in your theme/choild-theme footer.php right before the closing body tag (after wp_footer()):
<script>
(function($){
$(window).on("load",function(){
$("a[data-et-has-event-already][href*='#']").parents(".et_clickable").off("click")
.on("click",function(e){
var target=$(e.target);
if(!(target.is("a") || target.parents("a").length)){
var idTarget=$(this).find("a[data-et-has-event-already][href*='#']").attr("href");
$.mPageScroll2id("scrollTo",idTarget);
}
});
});
})(jQuery);
</script>
One thing though: You need to make your “Employees” card the same as the other ones (“HR & Broker Admins” and “Partners & Resellers”), i.e. make it have anchor links with actual href/URL values.
Let me know 🙂
-
This reply was modified 5 years, 2 months ago by
malihu.