• Resolved maryb77

    (@maryb77)


    Hi
    Can’t work out why it’s not working for my menu…
    It works is I test a shortcode link in my page like [ps2id url='#contact']shortcode link[/ps2id] and it targets the id=”contact” perfectly
    It works when I do a page reload like ie http://jdlgroup.com.au/#contact
    But when I just click on a menu item it jumps,
    Menu links to http://jdlgroup.com.au/#contact
    I’ve tried adding the class and rel as described in instructions to menu items and its still doesn’t work.

    I’ve tried deactivating all other plugins,
    Using Responsive theme

    http://jdlgroup.com.au/

    My site is currently using a ‘coming soon’ page for users not logged in, I can turn this plugin off briefly so you can look at it

    Thanks

    https://ww.wp.xz.cn/plugins/page-scroll-to-id/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author malihu

    (@malihu)

    Maybe the theme itself has an internal script to handle menu links (if it does, the solution would require some extra javascript).

    If you can temporarily disable maintenance mode, I’ll check it and let you know what happens.

    Thread Starter maryb77

    (@maryb77)

    Thanks, That’s deactivated

    Plugin Author malihu

    (@malihu)

    Your theme has a script (responsive-scripts.min.js) which includes a js click event that handles the navigation menu links and prevents ‘Page scroll to id’ from functioning.
    This function as far as I can tell cannot easily unbind and is applied only on the menu links (that’s why ‘Page scroll to id’ works on off-menu links, page load etc.).

    The only solution is to add extra javascript in your theme/template. Add the following script wherever your theme allows you to add custom javascript or directly in footer.php (after wp_footer(); function):

    (function($){
        $(window).on("load",function(){
            $(".main-nav ._mPS2id-h[href*='#']").click(function(e){
                e.preventDefault();
                e.stopPropagation();
                $.mPageScroll2id("scrollTo",$(this).attr("href"));
            });
        });
    })(jQuery);

    Hope this helps

    Thread Starter maryb77

    (@maryb77)

    Perfect that fixed it!
    Thanks heaps
    Mary

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Jumping not scrolling on menu’ is closed to new replies.