Jump to content
Search Community

ScrollTrigger + DrawSVG - Link path progress to different height sections

dvdslns test
Moderator Tag

Recommended Posts

Hi all! Im sorry for the somewhat vague title but couldn't find a shorter way to express my issue, and I was hoping to get some guidance 😓.

What I'm trying to achieve is to:
* build a side navigation with 4 evenly distributed points, each one pointing to one of the 4 sections on the page
* I'm using drawSVG to fill the nav path as we scroll
* however, fill is relative to the page height, so I'm looking for a way to "slow down" the fill speed to match the distance scrolled at each section (does that make sense?)

 

For example, in the attached pen, if I were to scroll to section 3, the nav svg path should be filled up to the label "section 3".

 

Is this possible? Thanks for your help!

See the Pen mdpLQee by omaidog (@omaidog) on CodePen

Link to comment
Share on other sites

Hi dvdslns,

 

Instead of animating a single path, you will probably need break apart your path into individual sections, and animate each section individually to better match up with your scrolling section. It might take a little finessing as matching up a curved path with linear scrolling is not a 1:1 relationship.

 

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