jquery slideUp/slideDown functions not animating
Asked Answered
N

5

13

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?

Neel answered 2/8, 2011 at 19:9 Comment(1)
There may be an issue with the fact that you are using a table, check this out: https://mcmap.net/q/461208/-slidetoggle-in-table-rowOsborne
M
32

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.

Mauney answered 2/8, 2011 at 19:20 Comment(3)
Beat me to it +1 you can fade the row in/out but you cant slide it because <tbody> isn't affected by height.Brandwein
I'm new to this site. It looks like you have to be quick to answer! I need to start posting some of my hard questions. Thanks Gallen!Mauney
I know this is old, but just in case - the animation will also not appear if applying using display: table;.Estafette
H
7

Also, check you don't have CSS transitions set on your element, or globally to all elements. This will screw with your animations:

* {transition: all 0.1s ease;}
Heck answered 29/6, 2015 at 11:9 Comment(1)
I was using a div element, so the accepted best answer didn't answer my question. This answer solved my problem.Floweret
W
4

Can be done if you create a div layer inside your tds and animate that instead. It's not hard to programmatically add divs when creating your table.

Demo: http://jsfiddle.net/jpillora/wU7RV/

Warbeck answered 1/7, 2012 at 1:16 Comment(1)
Bingo. Thanks. I was injecting a new row via ajax and targeting the <tr> element with slideDown(), but targeting the div inside <td> did the trick.Squid
I
0

Tbody can't be animated. Try to limit the height of Tbody and you'll see that it doesn't change the height.

Impediment answered 2/8, 2011 at 19:17 Comment(0)
F
0

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.

Fornof answered 2/8, 2011 at 19:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.