jquery - javascript toggle table row background color on click -
so have javascript code on table row click exapnds subsequent table rows until finds same table row class again.
if hover on row changes gray expected.
the stuff doesn't work when click on table row, want table row background color same hover (gray). color should disappear when click , collapse row.
i tried add toggle class seen below.
$('.my-class').click(function(){ $(this).nextuntil('tr.my-class').slidetoggle(100); $(this).toggleclass("tr.my-class.negative.clicked"); });
but not sure if right approach. here jsfiddle: http://jsfiddle.net/dhdrg/3/
just heads up. worked , might better solution:
$('.my-class').click(function(){ $(this).nextuntil('tr.my-class').slidetoggle(100); $(this).toggleclass("clicked"); });
Comments
Post a Comment