Jump to content
Search Community

Gsap SmoothScroll Custom Cursor is Not Moving Enough

Sıradışı Digital test
Moderator Tag

Go to solution Solved by Rodrigo,

Recommended Posts

  • Solution

Hi,

 

The problem here is that your cursor element has a position fixed and everything with position fixed inside a transformed component doesn't behave in the way it normally does:

https://stackoverflow.com/questions/15194313/transform3d-not-working-with-position-fixed-children

 

The ScrollSmoother docs mention to move fixed elements outside the smooth wrapper:

Caveats
position: fixed should be outside the wrapper - since the content has a CSS transform applied, browsers create a new containing block and that means position: fixed elements will be fixed to the content rather than the viewport. That's not a bug - it's just how CSS/browsers work. You can use ScrollTrigger pinning instead or you could put any position: fixed elements OUTSIDE the wrapper/content.

 

Here is a fork of your codepen with the latest syntax as well:

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

 

This also uses GSAP QuickTo as well:

https://greensock.com/docs/v3/GSAP/gsap.quickTo()

 

Hopefully this helps.

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