Have a look at this jsfiddle: http://jsfiddle.net/Dh96F/1/
The Expand button will animate the widening of the middle column. When it does this, you will see how things get shifted to the next row while the animation is underway. The same is true when contracting the column.
Since I’m fairly new to jQuery, I have not seen this before and I was wondering why it happens and how it might be possible to keep all the siblings on the same line while the animation completes.
Thanks.
UPDATE: SOLVED – Thanks to @Alnitak for the education. I’m using jQuery in a Drupal 6.x environment and the jquery_update module would only bring the jquery version up to 1.3.2.
I found a hack to this module to allow me to use whatever jquery version I want. Your suggestion to upgrade was just the ticket! Cheers!
jQuery 1.3.2 is ancient – please consider upgrading.
If you select jQuery 1.4.4 or later on jsfiddle the problem doesn’t occur.
Specifically, it appears that the
.animate()method in jQuery 1.3.2 is overriding the style of your<ul>to beblockinstead ofinline-blockwhile the animation is happening. The later versions don’t do this.Try http://jsfiddle.net/qDwYE/, which I’ve set to stop the animation after 100ms and then display the
displayproperty. Then change to jQuery 1.4.4 and try the same again.This appears to be bug #2185.