P
P
Pavel Voronyuk2018-02-14 02:13:26
JavaScript
Pavel Voronyuk, 2018-02-14 02:13:26

Why doesn't toogleClass work?

There is such a markup https://codepen.io/pawlek/pen/xYraGG

I'm trying to do the following:

When you click on the button, the gray block should stretch to full screen where previously hidden inputs will be displayed (ideally a slider in which on each slide text + input ).

Faced the following stones:

1. I tried to make an additional hidden block that can be displayed using .click(), but I can't make a normal transition animation from a small block to a large one.

2. I decided to stretch the existing block and display previously hidden elements, but .toogleClass () does not work, but .addClass works fine. And again, it's not clear how to make a beautiful animation.

Help me find the right way to solve this issue.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Exploding, 2018-02-14
@pawlek

toggleClass
toggleClass
What exactly doesn't work? And in general, what does "normal / beautiful animation" mean in your understanding?

E
Eugene, 2018-02-14
@Elgorm

Your css transition is incorrectly specified. You need to use transition: changeable_property time.
For example transition: width .4s; or transition: all 1s;
https://html5book.ru/css3-transition/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question