简体   繁体   English

jQuery动画无法正常工作。 我需要在表格中添加一行动画

[英]Jquery animate not working. I need to add a row to table with animation

I have a function that adds a row to a table the row id="dummy" I need it to animate this. 我有一个函数,将一个行添加到表中,行id =“ dummy”,我需要用它来对此进行动画处理。 I need the other rows to slide down. 我需要其他行向下滑动。

I have to the following code but it doesnt animate just adds the row. 我必须使用以下代码,但它不设置动画仅添加该行。

var removeImage = '<td><img src="images/b_redcross.gif" alt="" hspace=0 border="0" align="absMiddle" style="cursor:pointer;width:1.2em;width:1.2em; padding-left:5px; padding-right:5px;" ></td>';
        var html = '<tr><td class="blueFont_inset">test</td><td class="blueFont_inset">test</td>'+removeStaffImage+"</tr></td>";
        $(html).hide().insertAfter($("#dummy")).slideDown('slow'); 

This is addressed in the following question: 在以下问题中解决了此问题:

How to Use slideDown (or show) function on a table row? 如何在表格行上使用slideDown(或显示)功能?

Basically you need to wrap the content of the td in a div and animate that. 基本上,您需要将td的内容包装在div中并对其进行动画处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM