• kkeller9091

    (@kkeller9091)


    Plugin all of sudden stopped working on my site. It now does the normal Divi thing of scrolling too far past the anchor tag.

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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

    Thread Starter kkeller9091

    (@kkeller9091)

    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).

    Thread Starter kkeller9091

    (@kkeller9091)

    Absolutely!

    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 4 years ago by malihu.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Not working on Divi’ is closed to new replies.