我有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