jQuery slide is jumpy

前端 未结 27 1830
悲&欢浪女
悲&欢浪女 2020-12-07 16:52

I tried to slide in and out a DIV with the toggle function of jQuery but the result is always jumpy at the start and/or end of the animation. Here\'s the js code that I use:

27条回答
  •  遥遥无期
    2020-12-07 17:43

    I was using slideDown() like this

    $('#content').hide().delay(500).slideDown(500); 
    

    For me, it was the main container #content element. I was having it hidden and then calling slideDown(). I removed the padding property in the CSS and everything worked fine after that. It's usually a margin, padding, or % width, so the easiest method is commenting out each property and testing them 1 by 1 to get your results.

提交回复
热议问题