_
_
_umr2016-05-03 17:11:42
css
_umr, 2016-05-03 17:11:42

How to animate a block so that it expands evenly?

There is a block
ee03a1075c9c44d79197f11f0eab4f90.jpg
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

3 answer(s)
A
Andrey Sverdlov, 2016-05-03
@Umr001

It's still possible . Only on my hover

D
devstudent, 2016-05-03
@devstudent

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

D
Dark Hole, 2016-05-03
@abyrkov

Nothing surprising. It is necessary to do most likely everything either relatively or rigidly
If you would give an example on CodePen.io - there were more specific suggestions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question