Jump to content
GreenSock

Nwekar

swaptext effect problem

Moderator Tag
Go to solution Solved by Cassie,

Recommended Posts

hello, i have a black div that contain a swap text it work so well, but i want to the width of black div change when a text swap,

thanks 

See the Pen KKoJXWM by N-Nwekar20 (@N-Nwekar20) on CodePen

Link to comment
Share on other sites

  • Solution

Hey there!

 

Well, the container doesn't have any idea of how wide the word is at the moment as the words are out of the layout flow.

The easiest way to do this would probably be to manually set up a timeline and adjust the width of the container yourself based on the word.

 

You could also do something more dynamic by measuring the width of the incoming word and then setting the width of the container.

  • Thanks 1
Link to comment
Share on other sites

hey Thanks for replying,

could you show me something to figure out how to do it 

Link to comment
Share on other sites

Which option do you think you'd like to go for and what are you struggling to figure out from the explanation?

Link to comment
Share on other sites

i solved my problem with the first one thank you so much.

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