Jump to content
Search Community

Scroll jumps to top of the page after click button in Wordpress using ScrollSmoother

Miguel Espinosa test
Moderator Tag

Go to solution Solved by Rodrigo,

Recommended Posts

Hello, good morning

 

I am creating a website in Wordpress, where I have installed ScrollSmoother which is fantastic.

 

The problem I am finding is that when using a carousel and clicking the buttons to display the content, the scroll jumps to the top of the page (not the content in the first place) and when I scroll down again to continue browsing, the content jumps towards the top of the page. That is, the scroll loses its original position after clicking the button.

 

I tried putting a "#/" to the href to prevent the scroll from scrolling after the clicking the button, but this didn't work.

 

Also, I can't make a demo because it's a Wordpress installation, but if it helps I can add the link where it's hosted at the moment:

https://adcorp.mx/basavi/

 

Any help will be greatly appreciated. Thank you in advanced.

Link to comment
Share on other sites

  • Solution

Hi @mespinosa and welcome to the GreenSock forums!

 

First, thanks for being a Club GreenSock member and supporting GreenScok! 🥳

 

Is really hard to debug a live website, but still I was able to catch a few things. First you are using GSAP 3.11.1, please update to the latest version 3.11.3 and see how that works.

 

Also it seems that you are using a plugin for your accordion items (https://www.kadencewp.com/kadence-blocks/custom-blocks/accordion-block/). Have you tried some simple accordion stuff without a plugin and see if that causes an issue as well? I know it might not be the ideal situation, but I would look into that and also ask the folks that created the plugin if they can provide any orientation in that aspect.

 

These are my main suspects and unfortunately I can't more than this in terms of help without a reduced minimal demo that demonstrates that this happens when using only GSAP in order to isolate the problem as much as possible.

 

Let us know if you have any other question.

 

Happy Tweening!

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...