1 | One | some text |
2 | Two | some text |
3 | Three | some text |
4 | Four | some text |
5 | Five | some text |
6 | Six | some text |
$(document).ready(function() {
color();
$("#table-1").tableDnD({
onDrop:function(table,row){
var b = $(row).children().eq(0).text();
color();
}
});
});
function color()
{
var tbody = $("table[id='table-1'] tr");
tbody.each(function(index){
var cc = index%2;
if(0==cc)
{
$(this).removeClass();
$(this).addClass("aa");
}
else
{
$(this).removeClass();
$(this).addClass("bb");
}
});
}
script>
1 | One | some text |
2 | Two | some text |
3 | Three | some text |
4 | Four | some text |
5 | Five | some text |
6 | Six | some text |