jQuery slideToggle jumps around

前端 未结 18 1290
迷失自我
迷失自我 2020-12-16 18:13

I\'m using the jQuery slideToggle function on a site to reveal \'more information\' about something. When I trigger the slide, the content is gradually revealed, but is loc

相关标签:
18条回答
  • 2020-12-16 18:52

    I had the same problem with the .slideToggle, and BenAdler is right. Put everything you want to toggle in a div, and set the style for the div to something that contains overflow:hidden and position: relative. It will work fine after that.

    0 讨论(0)
  • 2020-12-16 18:53

    This is just a shot in the dark, but if the function is manipulating the height css property of your element(s), according to this site you have to separate the padding and display:none in your css to keep it from jumping

    0 讨论(0)
  • 2020-12-16 18:55

    Solved by adding to the toggled div:

    overflow: hidden; position: relative; 
    
    0 讨论(0)
  • 2020-12-16 18:55

    Try messing with how the element is positioned/displayed/floated. I've had similar problems which were solved by playing with those settings.

    0 讨论(0)
  • 2020-12-16 18:55

    had the same problem , found a problem maybe someone else had it .

    if you have min-height -> than you have a problem with slideToggle

    0 讨论(0)
  • 2020-12-16 18:58

    I've encountered the same error, solved it by positioning the element with position: relative; width: 709px; The fixed width did the trick.

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