Good day.
The following question arose:
On the page there is a form to fill out, which, if it is empty, must be folded (as if by an accordion, we can only see the arrow pointing to the turn down). When hiding and opening I use the slideDown and slideUp . But for some reason, the animation is sometimes quite jerky and stepped. Here is a sample code:

 $("#arrow").click(function() { if ($("[data-status]").attr('data-status') == "true") { $("[data-status]").attr('data-status', false); $(".my-form").slideUp(400, function() { $("[data-status]").removeClass("icon-chevron-down").addClass("icon-chevron-down"); }); } else { $("[data-status]").attr('data-status', true); $(".my-form").slideDown(400, function() { $("[data-status]").removeClass("icon-chevron-down").addClass("icon-chevron-up"); }); } }); 
 .my-form { width: 100%; margin-left: 0; padding-top: 15px; border: 1px solid #CCCCCC; border-top: none; overflow: hidden; } 
 <div> <div class="span12"> <i class="icon-chevron-up" data-status="true" id="arrow"></i> </div> <form action="adress" id="form" method="get"> <div class="span12 my-form" style="display: block;"> ...... </div> </form> </div> 

The height of the form is not specified, because she is adaptive.
The bootstrap used (as far as I can tell from the available functions about 2) and jquery 2.0.3 .

Tell me which way you can dig, thanks in advance.

PS Link to JSfiddle: http://jsfiddle.net/7xpdwdnv/

  • jsfiddle.net/7xpdwdnv - here is a copy of your code, everything works smoothly. Probably, the problem is not actually in the code, but in the page styles, or in the form itself, or in some kind of add. a script that is trying to do something with a form. - Sergey Snegirev
  • Thank you so much for your time. Some kind of garbage to be honest (.. the only thing I can sin on is that a large enough page is being moved down - aleksandr revenko
  • Checked Everything works smoothly. And the page where this code is used is heavily overloaded? Is it really not a matter of the machine on which you are testing? Tried with other devices? - kashesandr
  • the spoiler itself contains up to 6 input fields and somewhere around 5-10 radiobuttons or checkboxes. and the content under the spoiler in the form of a table with 20 entries. it seems not very overloaded. Maybe the question is in the car .. but it seems that nothing extraordinary does not load it ... - aleksandr revenko

0