jQuery - Animate element that has children absolutely positioned outside it - blinking

后端 未结 4 636
攒了一身酷
攒了一身酷 2021-01-17 12:47

Forgive me if this has been addressed before, couldn\'t find anything.

I am animating a content bar that that has children absolutely positioned outside it (via nega

4条回答
  •  情书的邮戳
    2021-01-17 13:18

    When jquery is animating either the height or width of an element, it will automatically set overflow: hidden on the element while the animation is happening. Since your child element is positioned outside, it's technically part of the overflow. The comment in the jquery source near the code that does this says "//Make sure that nothing sneaks out." If you include the uncompressed jquery source and comment out line 4032 of jquery-1.3.2.js (inside the animate function):

    //this.style.overflow = "hidden";
    

    You will see that the animation works the way you intended. I'm not sure of a workaround other than modifying the jquery source by commenting out that line above.

提交回复
热议问题