Danile Yu Posted January 6, 2023 Share Posted January 6, 2023 This works perfectly except on Safari. What happened here? Thank you.  P.S. The issue on safari is laggy and the animation stopped  🤨  See the Pen bGjBRLv by yoz0713 (@yoz0713) on CodePen Link to comment Share on other sites More sharing options...
GreenSock Posted January 6, 2023 Share Posted January 6, 2023 That actually has nothing to do with GSAP - you can open Dev Tools and see that the values are changing exactly as they should. The problem is that Safari has quite a few rendering bugs and this is one of them. It doesn't repaint the graphics according to the changes that GSAP is making. Clip paths are just plain buggy in Safari. To force the browser to repaint things, you can use an onUpdate that basically removes the clip path and then re-applies it: See the Pen gOjLxPK?editors=1010 by GreenSock (@GreenSock) on CodePen  Better? Link to comment Share on other sites More sharing options...
Danile Yu Posted January 6, 2023 Author Share Posted January 6, 2023 Hi Jack, you're my hero,this problem bother me about three days...., and now this been solved cause your solution ! I wondering that I can ask a question about svg transform-origin , you can see the codepen I poseted , I use the code below , but the rect still expend from left side , how can I fix that,  Sincerely appreciate your help , have a nice day! gsap.set("#clipPath1 rect", { transformOrigin: "center center", }) Link to comment Share on other sites More sharing options...
GreenSock Posted January 6, 2023 Share Posted January 6, 2023 That's because transformOrigin only affects transforms, like scaleX, scaleY, rotation, etc. You're animating the "width" which has nothing to do with transforms. Maybe you could just animate scaleX instead: See the Pen rNrWzRy?editors=1010 by GreenSock (@GreenSock) on CodePen  Or you could counter-animate the "x" attribute in the opposite direction, but I think scaleX is probably easiest and most performant. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now