Smooth animations in jQuery UI Accordion
I was having trouble making my accordion slide (the default) animations smooth using the jQuery UI. The accordion would slide, but then sort of "jump" about 10 pixels up just after the slide effect.
If you are having the same problem, the fix was simple: I had a margin
set on the accordion header, and I changed it to padding
.
a.accordion_header {
display:block;
padding: 10px 0; /* Margin makes animation not smooth! */
}
Apparently the accordion plugin calculates the target height without the header margins included, so the animation ends up jumping a bit to make up for it.
Resources: