【发布时间】:2019-07-19 04:25:25
【问题描述】:
我有一张桌子
function updateQueueTable(sessionName) {
console.log("updateQueueTable executed ... ");
var ajax = $.ajax({url: '/client-summary/' + sessionName + '/queue'});
ajax.done(function (responses) {
console.log('responses = ', responses);
$('#queueTable').empty();
for (i = 0; i < responses.length; i++) {
let row = `
<tr >
<td>${responses[i].flow_type}</td>
<td><a href="/client-summary/${responses[i].session_name }">${responses[i].session_name }</a></td>
<td>${responses[i].vlan}</td>
<td>${responses[i].source_ip}</td>
<td>${responses[i].tunnel_endpoint}</td>
<td>${responses[i].ue_mac}</td>
<td>${responses[i].ue_type}</td>
<td>${responses[i].action}</td>
</tr>
`;
//**/console.log(row);
$('#queueTable').prepend(row).fadeIn('slow').animate({ color: "#FFCD56" }, 1400).animate({ color: "white" }, 1400);
}
});
}
我可以看到 prepend 正在发生,但 fadeIn 和颜色变化没有。
我做错了什么?
HTML
<table class="table table-responsive-sm">
<thead>
<tr>
<th width="10%">Type</th>
<th width="10%">Session Name</th>
<th width="5%">VLAN</th>
<th width="15%">Tunnel Source IP</th>
<th width="15%">Tunnel Dest IP</th>
<th width="15%">MAC Address</th>
<th width="15%">Tunnel Type</th>
<th width="15%">Action</th>
</tr>
</thead>
<tbody id="queueTable">
</tbody>
</table>
【问题讨论】:
-
你能添加
#queueTable的html吗? -
@justDan 我添加了,你可以看看。 ?
-
您希望淡入表格或行吗?代码正在淡化表格。
-
我希望淡入刚刚插入的新行。
标签: javascript jquery html css html-table