Jump to content

Sıradışı Digital

Gsap SmoothScroll Custom Cursor is Not Moving Enough

Moderator Tag
Go to solution Solved by Rodrigo,

Recommended Posts

I have a problem when I use custom cursor with smoothscroll plugin. The error occurs when I scroll down the page. Is there any way I can fix this problem?

See the Pen yLQLrRY by mrtsiradisi (@mrtsiradisi) on CodePen

Link to comment
Share on other sites

  • Solution



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:



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

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:



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.