jQuery slide is jumpy

前端 未结 27 1859
悲&欢浪女
悲&欢浪女 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:17

    Jerking happens when the parent div ".wrapper" in your case has padding.

    Padding goes on the child div, not the parent. jQuery is animating height not padding.

    Example:

      

    Here's some text. And more text. Test1

    Some content

    More blalba

    Hope this helps.

提交回复
热议问题