Jump to content
Search Community

Cursor change over block - offset issue

Mattrudd test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

Hi folks, trying to integrate a cursor change on hover (a play button over a video thumbnail).


I can't seem to work out why, when I add the hover section to a page with ScrollTrigger, the button appears above (offset - vertically up the page from) the container and not over it as intended?


Tried lots of variations of thumbnail container CSS positioning so wondering whether I'm missing something in my scroller proxy settings?


See the Pen zYPpamW by matt-rudd (@matt-rudd) on CodePen

Link to comment
Share on other sites

  • Solution

If I understand your question correctly, that's just how CSS works. If you put a position: fixed element inside a container that has a transform applied to it (which LocomotiveScroll does), it suddenly makes the fixed positioning relative to the container instead of the viewport! Annoying, I know. But again, it's completely unrelated to GSAP/ScrollTrigger. 


If you want it to act relative to the viewport, you'll need to remove it from that transformed container or counter-transform it in the opposite direction as its container is moving to compensate. 


Good luck!

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