R
R
rsoinvi2016-04-03 19:53:28
JavaScript
rsoinvi, 2016-04-03 19:53:28

How to animate class substitution with jquery?

Task. When I click, I change the attribute (change the class). The new class gives the width change. How can I make it animate smoothly. The bottom line is not to change the width through animate, but simply replace the class

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2016-04-03
@rsoinvi

https://jsfiddle.net/soledar10/5xt2pLfd/
https://jsfiddle.net/soledar10/64Lvvn7m/

G
Gegam, 2016-04-03
@Gegam

We write a new class with a new width and hang it on the click event. Important! so that the previous size does not overlap the new one.
I threw an example in jsfiddle:
https://jsfiddle.net/ucgwfetq/16/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question