Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

ho i can pin a sub element on scrolling

Recommended Posts

Hello leenal,  welcome to the forum.

I’m sure that you will find it helpful.

there are plenty of experts who know more than me and thats a very interesting example that you raise.

i notice that you are using css transform and scroll trigger so I would be inclined to drop the css transform and do it all in green sock.
I would also be inclined to make  things simple and build an animation without using scroll Trigger as a starting point.
the basic essence seems to be a simple rotation of a complex div about an external pivot point.
Perhaps someone might have an example that they prepared earlier.





Link to post
Share on other sites


here's an example of rotating about an origin not at the center.

  • Like 1
Link to post
Share on other sites

Using an offset transformOrigin is the way to do this sort of thing. We highly recommend using the rotation property instead of passing in matrixes. You actually don't need pinning for this effect at all, the page you link just uses transforms.

Link to post
Share on other sites

I quite like that effect from the site you showed:




So I figured it was a good excuse to practice my ScrollTrigger and transform skills. Kind of finicky working out the css, there's a few different ways you coudl approach that. This seems to work pretty well.

See the Pen RwadBgG by Visual-Q (@Visual-Q) on CodePen

  • Like 4
Link to post
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.