how to make cell selection row by row not zigzag way
I want to drag the mouse on cell and whatever is under cells gets selected. only its under cell get selected. if user moves mouse zigzag way then no selection be happen. How can i do that. .
above image show correct way of flow
Here is a possible solution from the posted jsfiddle.
Instead of highlighting based on each item that has been moused over, we can look at the index of the first (being the one clicked) and the last (being the one currently hovered with an active click drag state) and highlight all cells between.
Check this jqfaq.com topic. i think this will help you to know on which element an item is currently being dragged on