I
I
istasiik2014-09-27 19:12:35
JavaScript
istasiik, 2014-09-27 19:12:35

How to set toggle close animation?

There is a code like this

$(document).ready(function(){
  $(".css-check").click(function(){
    $(".telephone").animate({
      height:'toggle'
    }, 600, 'easeOutBack');
  });
});


The animation for opening (easeOutBack) is set, but it closes at a linear speed. How to fix?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dima Pautov, 2014-09-27
@bootd

And what does toggle in the height property mean in your example?
Why not use the slideToggle function? She does the same for you!

V
Vyacheslav, 2014-09-27
@slavik_210

i like to add class and animate with css transition more. Eats less resources, but no animation in IE9 and below.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question