There is a button. When you click on it once, the div block should open. When pressed a second time, the block should close.

Did just what would open, and how to know the status and then close?

$( ".fa-edit" ).click(function() { $( ".cabinet-block-about-me" ).slideDown(300); }); 
  • slideToggle() - splash58

2 answers 2

The slideToggle() method results in a smooth collapse (if the element is expanded) or unfolding (if the element is collapsed) of the selected elements on the page.

 $("button").click(function() { $("div").slideToggle("slow"); }); 
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <button>Вуаля!</button> <br> <br> <div> <img src="/tags/images/yo.jpg" style="height:150px; float:right; margin:5px 5px"> <b>Правило.</b> Ё должна использоваться: в случаях возможных разночтений; в словарях; в книгах для изучающих русский язык (т. е. детей и иностранцев); для правильного прочтения редких топонимов, названий или фамилий. Во всех остальных случаях наличие буквы ё только затрудняет чтение. Она плохо выглядит, зато хорошо звучит. </div> 

Also, the second parameter can be passed to a callback — функция specified as an animation completion handler (appearing or hiding).

Details ...

    Use .slideToggle () instead of .slideDown ().