Jump to content
Search Community

scaleY a element with text stutters width (rhs)

matty_h test
Moderator Tag

Recommended Posts

Hello

I'm trying to scaleY a box with text and without setting a hard width as text can change.

https://stackblitz.com/edit/js-utdppg?file=index.html

When it animates in and out the right hand side jumps/stutters and changes width.

When there is no text, it works ok. What am I missing to make this work correctly?

 

Thanks

 

EDIT:

I removed the custom font which helped the stutter animating in, still hope to improve the outwards animation if possible! 

Edited by matty_h
Update
Link to comment
Share on other sites

5 hours ago, matty_h said:

When it animates in and out the right hand side jumps/stutters and changes width.

I'm not seeing that at all, but there does seem to be pixel snapping which can make it look a little jittery (totally a browser rendering thing, unrelated to GSAP). You can set will-change: transform on the element to force the browser to layerize it and put it on the GPU. Does that help? 

Link to comment
Share on other sites

Thanks 

On 3/3/2023 at 8:53 PM, GreenSock said:

I'm not seeing that at all, but there does seem to be pixel snapping which can make it look a little jittery (totally a browser rendering thing, unrelated to GSAP). You can set will-change: transform on the element to force the browser to layerize it and put it on the GPU. Does that help? 

 

On 3/3/2023 at 8:57 PM, Rodrigo said:

Hi,

 

On top of Jack's advice, maybe you could try using Clip Path in the text element as an alternative:

 

 

 

Hopefully this helps.

Happy Tweening!

 

Thanks both, looks much better!

 

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