[Resolved] Smooth Scroll not getting applied

Home Forums Support [Resolved] Smooth Scroll not getting applied

Home Forums Support Smooth Scroll not getting applied

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #632616
    drew

    I have the smooth scroll option activated but it doesn’t appear to be applying to links with the smooth-scroll class assigned.

    Example page in website URL field below.

    All four of the buttons inside the top section have the class assigned: <p style=”text-align: center;”><a href="#whoWeAre">Who We Are</a> <a href="#historicBuilding">Our Historic Building</a> <a href="#staffBoard">Staff & Board</a> <a href="#financials">Financials</a></p>

    But selecting the buttons still humps down without smooth scroll effect.

    However, the back to top button smooth scroll works fine.

    Suggestions?

    GeneratePress 2.1.3
    GP Premium 1.6.2
    #632889
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You need to add the smooth-scroll class to your links:

    <a href="#whoWeAre" class="smooth-scroll">Who We Are</a>

    #633292
    drew

    Hey Tom, they do have the class (I think it got stripped out when I pasted previously). Here is is again:

    <p style="text-align: center;"><a class="button smooth-scroll" href="#whoWeAre">Who We Are</a>

    Is there a second step to get it to work with the button class?

    #633683
    Tom
    Lead Developer
    Lead Developer

    Hmm, there’s a javascript error happening.

    Can you try deactivating your other plugins just to rule out some sort of conflict?

    #638869
    drew

    Blerg, I didn’t get the email notice for the follow up on this one (do you guys use a transactional provider or the default WP mail function?). Let me see about that and circle back.

    Drew

    #638909
    drew

    Okay, this is fun; it wasn’t a specific plugin, rather a specific custom functions snippet.

    Do you recall the exchange we had several months back about inserting SevernSpark’s ubermenu into the theme via custom snippet, that’s the culprit.

    if ( ! function_exists( 'generate_navigation_position' ) ) {
        function generate_navigation_position() {
            if( function_exists( 'ubermenu' ) ){
                ubermenu( 'main' , array( 'theme_location' => 'primary' ) );
            }
        }
    }

    Any thoughts on how to sidestep that?

    FYI, I did the deactivate process at a staging site: http://townhall.staging.wpengine.com/about – that snippet is deactivated at the moment and you can see the smooth scroll is working as expected.

    Drew

    #639110
    Tom
    Lead Developer
    Lead Developer

    I’m still seeing the javascript error. Did you re-add the function? I’m not seeing a menu anywhere?

    #639132
    drew

    It makes sense the menu wouldn’t appear since the snippet is deactivated on that staging install.

    I’m not sure what else the js error would be related to since I deactivated the other plugs but deactivating that snippet resolved the smooth scroll functionality. The only js error I see is realted to the smooth scroll function, is that the one you’re seeing: https://www.screencast.com/t/S6GhoVhWzP

    Otherwise, all other plugins (except GP Premium, Lightweight Grid Columns, and simple CSS) are disabled.

    CORRECTION: I did clear out object caching and I that seems to have made a difference. That js error is gone so the issue still seems to have something to do with that ubermenu insert snippet. Any idea as to why it would conflict with the smoothscroll?

    #639698
    Tom
    Lead Developer
    Lead Developer
    #639746
    drew

    For you, anything πŸ™‚

    That’s done on the staging site, I reactivated the insert ubermenu snippet, and the smooth scroll appears to be working on the /about page again. Yay!

    I checked it across a few different browsers and all seems to be working as expected too. What changed in the RC release?

    #639870
    Tom
    Lead Developer
    Lead Developer

    We re-worked things within the smooth scroll script in 1.7.

    It looks like the function you were using was breaking the document.body variable in javascript, which is really strange.

    Glad it’s working now πŸ™‚

    #640382
    drew

    Cool, is that RC version of 1.7b stable enough for me to push out on the client’s live site without worry about any ancillary issues?

    #640614
    Tom
    Lead Developer
    Lead Developer

    Yes, it’s very stable. The official version will be coming out this week πŸ™‚

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.