if i drag on minute 15 to 45 then name john having csstdgreen then i have i to make john block yellow. if i drag on minute 15 to 30 then jary having csstdgreen then i have i to make jary block yellow. i drag on minute 15 then jack having csstdgreen then i have i to make jack block yellow. only one at a time.How can i do that with jquery
i have shown an exmple here i have to do like this see demo
$(".csstdgreen").live('mousedown', function (e)
{
//This line gets the index of the first clicked row.
lastRow = $(this).closest("tr")[0].rowIndex;
$(this).removeClass("csstdgreen").addClass("csstdyellow");
e.preventDefault();
return false;
});
$(document).live('mouseup', function () { flag = false; });
$(".csstdgreen").live('mouseenter', function (e)
{
// Compares with the last and next row index.
currentRow = $(this).closest("tr")[0].rowIndex;
if (lastRow == currentRow || lastRow == currentRow - 1 || lastRow == currentRow + 1)
{
lastRow = $(this).closest("tr")[0].rowIndex;
} else
return;
if (flag)
{
$(this).children(":not(:first)").addClass("csstdyellow");
e.preventDefault();
flag = false;
}
});