Jump to content
Search Community

Help with ScrollTrigger and MotionPath ?

Rafik Outside

Go to solution Solved by Rodrigo,

Recommended Posts

Rafik Outside
Posted

Hello there I am new to gsap I am researching for a website I have a section with 4 rows of alternating image  and content    and  I am trying to slide image in a svg path while scrolling to the end of svg. I having problem align the items with original position  image in section with svg as I can't find the percentage of offset of the image in the svg path according to height of original image. Can somebody please help me solve this problem.

 

See the Pen OPJqVMg by rafik-outside (@rafik-outside) on CodePen.

  • Solution
Posted

Hi,

 

Using the anchorsToProgress helper function you can achieve that:

https://gsap.com/docs/v3/HelperFunctions/helpers/anchorsToProgress/

 

Here is a fork of your demo:

See the Pen YPzgQzr by GreenSock (@GreenSock) on CodePen.

 

The only issue is that the anchors in the path doesn't seem to match with the tangent points of your curve, so you should have a look at your SVG path and correct that.

 

Hopefully this helps

Happy Tweening!

Rafik Outside
Posted

@Rodrigo Thank you for the help. I really appreciate it

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