Jump to content
Search Community

ScrollSmoother not Working Vanilla JS

Shaban Iddrisu™ test
Moderator Tag

Recommended Posts

Hello,

 

I have been using ScrollSmoother since it was revealed and I never had any issues with it until now. I am trying to use it in my current project and it is very choppy, sticky and unusable. I tried everything I could to make it work and yet nothing.

It is quite strange why I am having this issue. My HTML structure still contains a "#main-wrapper" and a "#scrollable" container. Previously the "#scrollable" was the only child of the "#main-wrapper"; however, now that's not the case because I am removing the current "#main-wrapper" and replacing it with the next "#main-wrapper" on Barba Js page transition.

Not only that, now it won't work even on CodePen too. 
Perhaps I am missing a crucial step, I can't tell; hence, it would be great if you would facilitate me.

I have attached a short video recording showing how choppy it is for your reference.

Thanks,
Regards.

See the Pen bGQEQXe by shaban-iddrisu (@shaban-iddrisu) on CodePen

Link to comment
Share on other sites

Hi,

 

Is hard to tell about the issues in your site, but at least in the codepen example you're not adding ScrollTrigger, keep in mind that ScrollSmoother works on top of ScrollTrigger. Here is a fork of your codepen that includes ScrollTrigger and seems to work as expected with the same markup:

See the Pen XWyXoww by GreenSock (@GreenSock) on CodePen

 

Check your project to see if you included ScrollTrigger and that is registered as well.

 

Hopefully this helps.

Happy Tweening!

  • Like 1
Link to comment
Share on other sites

Hello @Rodrigo
Thanks for your response.

I confirm adding the ScrollTrigger to my project in CodePen solved the issue; however, NOT in my main project.

I did add the ScrollTrigger happily thinking all will be solved and still, the issue kept on. So I did a little digging in my code, and voila..!

 

I have a custom utility called Use. In there, I create almost every reusable functions, variables, components etc to be instantiated anywhere I need it in my projects.

Amongst these is the CustomEase setup I have.


One of the custom ease functions was my downfall, it is named"expo" which I think is conflicting with some internals of either ScrollTrigger or ScrollSmoother.

Here is a link to a video demonstrating the issue.

If that's the case, I think users should be aware of this and a feasible solution implemented as soon as possible.

Thanks,
Regards.

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...