• Everything works fine, the offset, animation, everything. But when I click a button to scroll to the ID, it scrolls, then goes to the top and scrolls again, effectively triggering the event twice.

    What am I doing wrong?

    thanks!

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

Viewing 1 replies (of 1 total)
  • Plugin Author malihu

    (@malihu)

    Hello,

    You’re not doing anything wrong. It seems that there’s another script in your theme that has its own page scrolling animation that’s messing with “Page scroll to id”.

    The script is this:

    ...themes/salient/js/init.js

    and the culprit function starts in line 18186.

    To solve this, first try going to “Page scroll to id” settings and set “Prevent other scripts from handling plugin’s links selector(s)” field value to:

    #header-outer nav .sf-menu a

    Save changes and test.

    If the above doesn’t solve the issue, you’ll have to add a small js script in your page template.

    You can do this by editing your theme/child-theme footer.php add add the following in a new line, right above the closing body tag (</body>):

    <script>
    (function($){
    	$(window).on("load",function(){
    		$(".__mPS2id").parent("li").parent("ul").removeClass("sf-menu");
    	});
    })(jQuery);
    </script>

    Save/update the file and test. Scrolling should work without up/down hiccups.

    Let me know

    • This reply was modified 3 years, 10 months ago by malihu.
    • This reply was modified 3 years, 10 months ago by malihu.
    • This reply was modified 3 years, 10 months ago by malihu.
Viewing 1 replies (of 1 total)

The topic ‘Link triggering scroll event twice?’ is closed to new replies.