Jump to content

Search In
  • More options...
Find results that contain...
Find results in...
Ultra Design Agency

Magic Scroll Draw SVG

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

OK I got this svg to animate successfully, however I cannot seem to trigger it when it enters the viewport.  I have tried about everything I can think of!  Also, if I want more than one instance do I need a for each?  My apologies for the learning curve.

See the Pen JjPgqLj by ultradesignagency (@ultradesignagency) on CodePen

Link to comment
Share on other sites

As Kishin said, it'd be best to have the timeline be paused initially and then play it once the browser has detected that it's in the viewport by using an Intersection Observer. I recently showed how to do that with a different animation in this post:


23 hours ago, Ultra Design Agency said:

if I want more than one instance do I need a for each?

There are different methods of looping through an array but a .forEach is a valid way of doing so. It's what I used in the demo in the post above.

  • Like 1
Link to comment
Share on other sites

yes! I can finally give back to this awesome community :D

@Ultra Design Agency using scroll magic it would be something like this:

See the Pen 81f67d338806c2c3bd3fc683ad12a48a by ionz149 (@ionz149) on CodePen


Also @mikel has posted a really good example in your previous text animation thread of the intersection observer, that you should be able to mess with and get going:

See the Pen GVpojX by mikeK (@mikeK) on CodePen


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