I would like to set the animation speed of toggleClass
but it did not work. I solved the problem with CSS
:
-webkit-transition: all .5s ease;
transition: all .5s ease;
However, I would like to know what it would look like jQuery
?
Here's how I tried:
$(document).ready(function() {
$("#help").click(function() {
$("#faq").toggleClass("col-md-10", 500);
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><divclass="col-md-12" id="faq">
<p>
Exemplo exemplo Exemplo exemplo Exemplo exemplo Exemplo exemplo Exemplo exemplo
</p>
<input type="button" id="help" value="change-heigth">
</div>