Just_Jack Posted July 23, 2020 Share Posted July 23, 2020 I would like to ask for your help on how to make a stroke width go from big too small. I’ve tried using drawSVG and defining the strokeWidth. I also tried something like this: gsap.fromTo("#svg", {duration: 1, scale: 2.0, strokeWidth:10}); gsap.to("#svg", {duration: 1, scale: 1.4, strokeWidth:4}); But, it didn’t work. Link to comment Share on other sites More sharing options...
PointC Posted July 24, 2020 Share Posted July 24, 2020 Looks like you're targeting the whole SVG. You'd want to target the actual path or line that needs to be animated. gsap.to(yourTargetElement, {duration: 1, scale: 1.4, strokeWidth:4}); Make sense? Happy tweening. 2 Link to comment Share on other sites More sharing options...
PointC Posted July 24, 2020 Share Posted July 24, 2020 PS targeting the whole SVG could work if you set those attributes on the root SVG, but I'm guessing they're on the path or line. 1 Link to comment Share on other sites More sharing options...
mikel Posted July 24, 2020 Share Posted July 24, 2020 Hey @Just_Jack, Here an example See the Pen ZEQPajv by mikeK (@mikeK) on CodePen Happy tweening ... Mikel 1 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