问题描述
我有这个小小的jQuery slideDown效果
但动画不流畅?我做错了什么?
感谢您的时间。
>您只需将宽度添加到每个可展开的div。
解释:
jQuery doesn'不知道隐藏div的大小,直到显示出来。所以当它被点击时,它实际上会将它拉出来以便在快速替换它之前进行测量。这往往有导致一些跳跃的副作用。设置元素的宽度可以防止jQuery将它拉出来。
I have this little jQuery slideDown effect http://jsfiddle.net/Gg4eP/2/
But the animation isn't smooth? What I am doing wrong?
Thanks for your time.
You just need to add the width to each expandable div.
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.
这篇关于jQuery slideDown不平滑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!