我有HTML表格。这是行之一:如何使用jQuery去除某些效果的css类?
<tr class="mattersRow">
<td colspan="4"> … </td>
<td class="editableCell qbmatter" colspan="14"> … </td>
<td class="editableCell workDate" colspan="4"> … </td>
<td class="editableCell hours" colspan="2"> … </td>
<td class="editableCell person" colspan="6"> … </td>
<td class="rate" colspan="2"> … </td>
<td class="editableCell amount" colspan="4"> … </td>
<td align="center">
<input id="check4" type="checkbox"></input>
</td>
</tr>
最后一列包含复选框。当我检查/取消选中时,我想为此行添加/删除css类。
$("input[type=checkbox]").click(function() {
if ($(this).is(':checked')) {
// Mark this Row Yellow
$(this).closest('tr').addClass('warning');
}
else {
// Remove Yellow mark and put back danger if needs
$(this).closest('tr').removeClass('warning');
}
});
该课程使整排黄色。基本上我想这样做有一些效果。例如,当我取消选中,这个“黄色”正在下降...如何在jQuery中做到这一点?可能吗?
http://jsfiddle.net/eh3ER/ – voodoo417
你能提供的样品代码?我不熟悉转换... – Bryuk