Jump to content

Search In
  • More options...
Find results that contain...
Find results in...
Umair liaqat

Gsap motionpath object animating out of viewport.

Recommended Posts


 this codepen is not working correctly (codepen url 

See the Pen eYGaNJV by Umairliaqat (@Umairliaqat) on CodePen

i am experiencing same issue on my website. code is not working in chrome but working in safari. 
this codepen is working fine but not working on my website. 

it has been more than a week since i am stuck on this issue. this is draining my energy and time. 
can anyone please help me here. i tried to use css offset path which work fine in chrome but don't work in safari so i switched to gsap and still hanging.

i have already used 
svg * { 
  transform-origin: center;
  transform-box: fill-box;

See the Pen VwMovJm by Umairliaqat (@Umairliaqat) on CodePen

Link to comment
Share on other sites

Hey there!


The GSAP example is working perfectly for me. I've attached a screenrecording from chrome.

Is this what you're after? If not, what are you expecting to see as a result of this code?



  • Like 2
Link to comment
Share on other sites

Hi Umair,


The issue is that you're using transform-box on your live version. GSAP doesn't need that so it messes up the calculations.

This pen's working perfectly because it doesn't use transform-box. 

See the Pen MWOgvEd?editors=1010 by GreenSock (@GreenSock) on CodePen

  • Like 3
Link to comment
Share on other sites

Thanks @Cassie
i need to test this solution. but luckily i figured out an other solution. i have to place birds and motion path at the origin while designing. Now if I export them and use them, they work fine, i have to use transform: translate to position the birds correctly. 
the most important thing is the the object which will move on the path must be at the origin when exported from a design tool like Figma or Adobe xd. 
i appreciate your effort and will let you know my status on your code suggestion.

Link to comment
Share on other sites

Hey @Umair liaqat

Glad you got it working - but the object doesn't have to be at the origin when using GSAP.


If you want it to be aligned to the path you can just use align: "#path" instead of align: "self"

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.