Answer the question
In order to leave comments, you need to log in
How to animate a block so that it expands evenly?
There is a block
This slanting line should open in both directions on click as indicated by the arrows. But here's how to do it exactly xs. I moved it to left: 50% and made it 150px wide, on click I make it left: 0 and 100% width the effect is not what I expected. Need help
Answer the question
In order to leave comments, you need to log in
need code!, but in general, it may be necessary to change only the dimensions, and leave the position as it is, that is, 50%.
+ transition for smoothness.
try resizing via transform:scale(1); -> transform:scale(1.5); transfrom-origin:center center; something like this ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question