Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery slideToggle effect not smooth

<div class="searchDiv">
    <div class="row"></div>
    <div class="row"></div>
    <div class="row"></div>
    <div class="row"></div>
</div>

I am trying to call $("div.searchDiv").slideToggle("slow"); on div with class searchDiv which is hidden initially using display:none. There are again some div elements inside those 4 div's with class row. Does it matter how the elements are placed inside the main div searchDiv because I see that the the toggle effect is not smooth for the elements placed inside the main div.

like image 652
user2585299 Avatar asked Apr 04 '14 19:04

user2585299


1 Answers

I had a similar problem. Two things fixed it for me.

  1. I needed to remove existing transition css on my element.
  2. I had an element inside my "clicking bar" (h2) that needed margin set to 0. (it was making other elements animate to the wrong boundary - causing a strange snap at the end)
like image 111
Ivan Town Avatar answered Nov 16 '22 02:11

Ivan Town