jquery SlideUp/slideDown 函数没有动画
我在使用 .slideup()
和 .slideDown()
时遇到问题,
请查看以下 JSFiddle:http://jsfiddle.net/7se2r/4/
虽然该行出现和消失,但我没有看到向上或向下滑动的动画。关于我做错了什么有任何线索吗?
I'm having trouble with .slideup()
and .slideDown()
have a look at the following JSFiddle: http://jsfiddle.net/7se2r/4/
Although the row is appearing and disappearing, I'm not seeing the animation of sliding up or down. any clue as to what I'm doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
对于“tbody”,您可以使用.show(“slow”)和.hide(“slow”),但不能执行滑动动画。
例如,如果您在“div”上尝试滑动,那么滑动就会起作用。
With "tbody" you can use .show("slow") and .hide("slow"), but you can't do the sliding animation.
Sliding will work if you try it on a "div" for example.
另外,请检查您是否没有在元素上或全局所有元素上设置 CSS 过渡。这会破坏你的动画:
Also, check you don't have CSS transitions set on your element, or globally to all elements. This will screw with your animations:
如果您在
td
内创建一个div
图层并对其进行动画处理,则可以完成此操作。创建表格时以编程方式添加div
并不难。演示:http://jsfiddle.net/jpillora/wU7RV/
Can be done if you create a
div
layer inside yourtd
s and animate that instead. It's not hard to programmatically adddiv
s when creating your table.Demo: http://jsfiddle.net/jpillora/wU7RV/
Tbody 无法设置动画。尝试限制 Tbody 的高度,您会发现它不会改变高度。
Tbody can't be animated. Try to limit the height of Tbody and you'll see that it doesn't change the height.
设置表格的一部分尺寸仅用作最小尺寸,因此表格的该部分立即以全尺寸可见,并且高度的动画没有效果。
Setting the dimensions of a part of a table is only used as the minimum dimension, so the section of the table is immediately visible at full size, and the animation of the height has no effect.