jQuery slide is jumpy

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

    Ran into this issue today, saw this question, and started tinkering based on what I saw here. I solved our jumpy issue by removing the position:relative from the CSS of the containing div. No more weirdness after that. My 2 cents.

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-12-07 17:43

    For me the solution was, that i had a CSS style definition like following:

    * {
        transition: all .3s;
    }
    

    Removing this was the solution!

    0 讨论(0)
提交回复
热议问题