Support » Plugin: Page scroll to id » No more smooth scrolling

  • Resolved elwin ransom

    (@aaronyoungren)


    I’ve used your plugin on many websites. I recently migrated the websites to a new hosting service, and suddenly the smooth scrolling doesn’t work, and the scrolling stops short of the targets. Do you know why this might be happening?

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

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

    (@malihu)

    It’s not the new hosting. You use another plugin (“mobile menu”) which prevents “Page scroll to id” from scrolling the page (don’t know if you installed or updated the “mobile menu” plugin recently along with the hosting change).

    Go to “Page scroll to id” settings and change “Selector(s)” option to:

    a[href*='#']:not([href='#'])

    Also, enable/check “Prevent other scripts from handling plugin’s links” option.

    Save changes and test your page.

    PS. I think you also posted a support request in plugin’s homepage which I’ve already responded (check it here).

    marreaint

    (@marreaint)

    I have the same problem. Everything works amazingly (great plugin!) until I activate the Mobile Menu plugin. Per the above instructions, I have changed “Page scroll to id” settings “Selector(s)” option to:

    a[href*='#']:not([href='#'])

    and I enabled/checked “Prevent other scripts from handling plugin’s links” option.

    Still, my links no longer smooth scroll and won’t scroll all the way down to the target when I enable the Mobile Menu Plugin. Offset has no effect. How can I fix this?

    My site url: http://bit.ly/2TT1o8x
    (On-page links are How it works, Pricing, FAQ, and Contact)

    Plugin Author malihu

    (@malihu)

    @aaronyoungren @marreaint If plugin’s “Prevent other scripts from handling plugin’s links” option cannot fix this automatically, you need to do it manually.

    Try this:

    1. Edit ...plugins/mobile-menu/includes/js/mobmenu.js

    2. Find line 165 and change it from:

    .not('[href="#0"]')

    to:

    .not('[href="#0"]').not('._mPS2id-h')

    Save the file and test your page.

    Let me know if it worked.

    elwin ransom

    (@aaronyoungren)

    Thank you! I will try this tomorrow. Again, great plugin!

    marreaint

    (@marreaint)

    I changed .not('[href="#0"]') to .not('[href="#0"]').not('._mPS2id-h') and it still jumps. No smooth scroll.

    Plugin Author malihu

    (@malihu)

    @marreaint @aaronyoungren OK. This should work:

    Add the following right below line 166 of mobmenu.js:

    if($(this).hasClass("_mPS2id-h")) return;

    so the code becomes:

    .on( 'click', function(event) {
          if($(this).hasClass("_mPS2id-h")) return;
          // On-page links

    Save and test.

    I’ll try to see if I can add a fix for this on the next version of the plugin.

    marreaint

    (@marreaint)

    malihu, this is amazing. Thank you for the support. It works now. I’m donating.

    Plugin Author malihu

    (@malihu)

    @marreaint Thanks a lot for the donation 🙂

    I’ve just updated plugin’s development version, so the plugin can deal with this issue automatically (just by having the “Prevent other scripts from handling plugin’s links” option enabled).

    This will be part of the next plugin version (1.6.5) so users won’t have to manually edit any js files.

    If you want to test this now, you can download and activate “Page scroll to id” development version.

    PERFECT. That worked! Thanks so much!

    Hi @malihu
    Thanks again for your amazing level of support.

    I implemented this fix across many sites. It worked on several, but on others it doesn’t. You’ll see that the change is made in the example below, but the menu is still not scrolling.
    https://vintageaustin.org/
    https://vintageaustin.org/wp-content/plugins/mobile-menu/includes/js/mobmenu.js

    Any thoughts?

    Plugin Author malihu

    (@malihu)

    @aaronyoungren Hello again,

    This is because the plugin is not enabled on the mobile menu links. This happens because of the way the mobile menu function works (I think it’s because of its menu walker function).

    The solution is simple:

    Go to “Page scroll to id” settings and change the “Selector(s)” option value from:

    a[rel='m_PageScroll2id']

    to:

    a[rel='m_PageScroll2id'], .menu-item a[href*='#']:not([href='#'])

    Save changes and test your site(s).

    If you want to enable “Page scroll to id” on all in-page links, you can simply set the “Selector(s)” option to:

    a[href*='#']:not([href='#'])

    The second option worked! Thank you again!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘No more smooth scrolling’ is closed to new replies.