AsKadir Posted June 25, 2020 Share Posted June 25, 2020 Hey! I have a question about pinning in ScrollTrigger. Is it possible to make pinning with scrub? I mean when I scroll, pinned element should catching up its fixed position with smooth ease. I understand that it uses position: fixed, so I can't imagine how it can be done. Can you give me advice, please? See the Pen NWxgyoM by ChicagoJostik (@ChicagoJostik) on CodePen Link to comment Share on other sites More sharing options...
ZachSaucier Posted June 25, 2020 Share Posted June 25, 2020 Hey Aslan. Are you talking about creating an effect like this site? https://www.marvinschwaibold.com/ 1 Link to comment Share on other sites More sharing options...
AsKadir Posted June 25, 2020 Author Share Posted June 25, 2020 23 minutes ago, ZachSaucier said: Are you talking about creating an effect like this site? https://www.marvinschwaibold.com/ @ZachSaucierHey, Zach! No, I mean when element is pinned, you scroll down and element is moving with the same speed as scrollbar, right? But what if we can make when you scroll, pinned element will move with some delay relatively to scrollbar. For example, popular gsap cursor animation, if we use gsap.set() it will be deadly pinned to cursor, but if we use gsap.to() with some duration, the cursor will be moving with duration, right? So in my codepen pinned element is the cursor with gsap.set(), but I want to make gsap.to() with duration. Did you undestand my explanation?) I'm so sorry. Link to comment Share on other sites More sharing options...
ZachSaucier Posted June 25, 2020 Share Posted June 25, 2020 I think that's pretty much what the site that I linked to is doing except it's not just during a pin Unless I'm misunderstanding you. Do you know of a website that does the effect that you're talking about? 1 Link to comment Share on other sites More sharing options...
AsKadir Posted June 25, 2020 Author Share Posted June 25, 2020 6 minutes ago, ZachSaucier said: Do you know of a website that does the effect that you're talking about? No( But after our dialogue I've found out that I can make animation that I want like this: See the Pen MWKoLEq by ChicagoJostik (@ChicagoJostik) on CodePen 😅 sorry for disturbing you! 2 Link to comment Share on other sites More sharing options...
ZachSaucier Posted June 25, 2020 Share Posted June 25, 2020 Good work! That works great in the case of pinning. I made this demo to show how the same sort of thing would be done without pinning (like the effect in the site that I linked to): See the Pen 9a64fe2c157fb3b810fe419a40182e27?editors=0010 by GreenSock (@GreenSock) on CodePen 3 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now