Jump to content
Search Community

Why is this clip-path animation not working?

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

Hi,

 

How do I animate clip-path using TweenMax? My code below does not work.

var clipFrom = "polygon(52% 0, 77% 0, 39% 100%, 16% 100%)";
var clipTo = "polygon(0 0, 100% 0, 100% 100%, 0 100%)";

TweenMax.fromTo('.some-element', 0.75, { clip: clipFrom }, { clip: clipTo, ease: Power4.easeOut }),
Link to comment
Share on other sites

Hello jesper.landberg, and Welcome to the GreenSock Forum!

 

I have some questions if you please:

  • What does your SVG markup look like?
  • Are you trying to animate elements within a SVG <defs> or <symbol> element?
  • Does it work in just Google Chrome and/or Safari?

Also keep in mind that CSS clip is not widely supported when it comes to animating polygon due to browser support. So non webkit browsers like IE11, MS Edge, or Firefox will not support or have partial support for CSS clip polygon.

 

If possible can you please create a limited codepen demo so we can better help you by seeing your code live and in an editable environment.

 

 

Thanks :)

  • Like 1
Link to comment
Share on other sites

Hello jesper.landberg, and Welcome to the GreenSock Forum!

 

I have some questions if you please:

  • What does your SVG markup look like?
  • Are you trying to animate elements within a SVG <defs> or <symbol> element?
  • Does it work in just Google Chrome and/or Safari?

Also keep in mind that CSS clip is not widely supported when it comes to animating polygon due to browser support. So non webkit browsers like IE11, MS Edge, or Firefox will not support or have partial support for CSS clip polygon.

 

If possible can you please create a limited codepen demo so we can better help you by seeing your code live and in an editable environment.

 

 

Thanks :)

Hi and thanks for the reply. 

 

I am animating a regular html element, so no SVG involved. I know the support isn't the best but it works if I animate it with CSS by toggling a "is-active" class so I thought I would be able to do the same with Tweenmax.

 

I will see if I can fix a simpel codepen=)

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