Disable click on minute cell

see violin

I have an html table and one text box and one button.make button selection, dragging an element on a cell. By clicking the button, I get the value of the text field and put it in the span tag of the cell. I have to disable the click on the minute cell 0,15,30,45. In the fiddle, you see, when I click on the minute cell, then it makes css green and the length of css increases (those who are in a warning state).

0
source share
1 answer

Is this what you want?

- EDITED -

Now you can select only straight lines (up or down). There may be a more elegant way to do all this, but I think it will work the way you want.

DEMO: http://jsfiddle.net/vrW2n/9/

// Add this variable var lastRow = 0; 

In mousedown() :

  // This line gets the index of the first clicked row. lastRow = $(this).closest("tr")[0].rowIndex; active = true; $(".csstdhighlight").removeClass("csstdhighlight"); // clear previous selection //This is the big trick $(".temp_selected").removeClass("temp_selected"); ... 

And in mousemove() :

 ... /* Begin my edit Compares the actual 'mousemove' row index with the last and next row index */ var thisRow = $(this).closest("tr")[0].rowIndex; if( lastRow == thisRow || lastRow == thisRow - 1 || lastRow == thisRow + 1 ){ lastRow = $(this).closest("tr")[0].rowIndex; }else return; // End my edit ... 
+1
source

All Articles