打开时jQuery UI Accordion Jumpy

问题描述:

我的页面上有一个手风琴小部件,它会在动画打开时缩小过去的位置(在动画结束时回复到正确的大小),并在开始动画关闭时捕捉到相同的扩展大小。在我的情况下,手风琴的内容应该扩展到150px,但我已经在Chrome的Inspect Element窗口中看到它的动画,并且看到它短暂地达到185px。

I have an accordion widget on my page that expands past where it should stop when animating open (snapping back to the correct size at the end of the animation), and snaps to this same extended-size when it begins to animate closed. In my case, the accordion content should expand to 150px, but I have watched it animate in Chrome's Inspect Element window and seen it go to 185px briefly.

我见过其他人建议填充和/或边距在将手风琴部分更改为 position:absolute 进行大小计算时可能会愚弄jQuery以进行计算。

I have seen others suggest that padding and/or margins may be fooling jQuery when it makes a size calculation when changing the accordion section to position: absolute briefly to make the calculation.

http://jsfiddle.net/shadowycore/T5fnZ/1/

我们非常感谢任何帮助。

Any help at all would be greatly appreciated.

我遇到了同样的问题,几个小时后我终于通过添加以下CSS来修复它:

I had the same problem and after a few hours I finally managed to fix it by adding the following CSS:

 .ui-accordion .ui-accordion-content{
      box-sizing:content-box;             
      -moz-box-sizing:content-box;
}

我希望这会有所帮助