There is a code in which the search rolls out and hides one element, but when you press it again, when the search hides back, the div element that disappears appears immediately, the whole site jumps from it; How to fix it?

 $('.search_1').hide(); $(document).ready(function() { $('.search').click(function() { $('.search_1').stop().animate({width: 'toggle'}); if ($('.order').css('display') !== 'none'){ $('.order').css('display','none');} else{ $('.order').css('display','block'); } }); }); 
  • With the solution of this situation will help "turn". Read more here: api.jquery.com/queue - NeedHate

1 answer 1

 setTimeout(function() { $('.order').css('display','block'); }, 800);