jQuery slideToggle jumps around

前端 未结 18 1336
迷失自我
迷失自我 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 19:11

    I had this issue when using floated elements inside the element that is toggled. Setting a width of 100% against the toggled element fixed this for me. If you wish to use padding then you may also set the box-sizing to border-box.

    Relative positioning is not required but you may wish to use overflow: hidden to clear the floated elements.

提交回复
热议问题