jQuery slideDown is not smooth

a 夏天 提交于 2019-12-01 03:26:19

You just need to add the width to each expandable div.

http://jsfiddle.net/BpMam/

To explain:

jQuery doesn't know the dimensions of your hidden div until it's displayed. So when it's clicked on it actually pulls it out of position to measure it before quickly replacing it. This often has the side effect of causing some jumpiness. Setting the width on the element prevents jQuery from pulling it out of position.

Some browsers don't particularly like text that is automaticly wrapped when animating, and it gets a little jerky when it tries to figure out the height of the element.

Try formatting the text to fit the element and see if that helps.

I actually did it for you, check if this FIDDLE solves it ?

Would probably work to give the slided elements a fixed height aswell ?

FIDDLE

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!