Jump to content
GreenSock

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

Unpin an element after gsap animation

Recommended Posts

Hi,

    I have created a gsap animation in my website. Inorder for it to autoplay i have not specified the duration while creating the scrollmagic scene. Now the animation is autoplaying (which is the intended effect if was going for) but now the section stays locked in place since there is no duration to tell the animation that it is over. So currently, the next elements are being overlapped by the pinned element. How can i fix this ? How can i unpin the element after the animation ?

See the Pen rNaKXmw by heinekhalwin (@heinekhalwin) on CodePen

Share this post


Link to post
Share on other sites

Hey Heinek and welcome to the GreenSock forums!

 

ScrollMagic isn't a GreenSock product and we don't really support it here. But we'd like to help if we can - you likely don't need ScrollMagic for this sort of thing. 

 

What's the end goal/behavior that you're wanting? From your description I can't really tell.

Share this post


Link to post
Share on other sites

Hi, 

      The effect i am going for is, i want the animation to stay pinned and to autoplay on reaching that element. Here, what is happening is, i'm using scrollmagic to pin the element in place till the animation is over. But since im not specifying the duration in scrollmagic, it stays pinned in place, even after the animation is over. Thanks for the speedy reply.

Share this post


Link to post
Share on other sites

So you want:

  1. User to scroll to where the top of "TEXT 2" is at the top of their viewport.
  2. "TEXT 2" element pins to the top.
  3. "TEXT 2" element animates somehow.
  4. When the animation is finished, it unpins and goes back to it's original position.

Is this correct? There are several unknown parts and I want to understand your goal before writing code. 

Share this post


Link to post
Share on other sites

I had tried something similar to this but the problem is that Intersection Observer is not supported apple devices below iOS 13. So I couldn't get it to work. This is an awesome solution though.

Share this post


Link to post
Share on other sites

Hi,

     Sorry for the late reply. But i managed to get it working in the way i wanted with scrollmagic's custom actions. Thanks for the help Zach, very much appreciated.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×