Jump to content
Search Community

Is there any option to make move animation inside Clipping mask SVG?

ahsartag test
Moderator Tag

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

Sorry to hear you are having trouble. SVG support for advanced masking / clipping is pretty tricky. It may not even be possible what you are trying to do.

The image you posted isn't much help and was on a bad site.

 

It is best to post a CodePen demo so that we can see and edit your actual code.

 

You can just fork this one, edit the code to match yours,  and save it: http://codepen.io/GreenSock/pen/MJGrxm

 

More details here: http://greensock.com/forums/topic/9002-read-this-first-how-to-create-a-codepen-demo/

 

You can't bind a click to a TimelineMax but you can click on any element and tell a TimelineMax to play. Is that what you mean?

  • Like 1
Link to comment
Share on other sites

I'm not sure if you meant animating other elements that are clipped/masked or the clips/masks themselves, but I'll offer my 2 cents worth here. I made this pen last summer as an answer to another forum question, but maybe it will help. It shows two circles being revealed. One with a clip-path and one with a mask. You can see that some browsers may or may not cooperate with what you'd like to animate. As Carl mentioned, some of this is tricky right now. 

 

See the Pen MewvjM by PointC (@PointC) on CodePen

 

Hopefully it helps a little bit.

 

Happy tweening.

:)

  • Like 1
Link to comment
Share on other sites

I don't see a CodePen link in your posts.

 

I'm still confused about the question. Are you saying child elements of a masked/clipped SVG won't tween?

 

If you create a CodePen demo, you don't have to upload your final assets. Can you demonstrate the problem with an SVG and a few circles, rectangles or polygons? You can just fork Carl's pen from Post #3 to get started.

 

Thanks.

 

Happy tweening.

:)

Link to comment
Share on other sites

  • 5 years later...
On 2/5/2017 at 6:21 PM, PointC said:

You're adding your clip-path to each individual path and rectangle. All you have to do to fix this is create a group around those elements and add the clip-path to that group. Here's a fork of you pen with that change:

 

 

 

 

Happy tweening.

:)

 

Wow! Thank you for the knowledge. This tip with clipping group and moving paths inside the group after save me.
One should remember that you have to resave your code from your vector editor instead of trying to change the html code of svg. It worked that way for me.

 

 

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