Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript coding seems to stall
    text
    copied!<p>Sorry for the vague title but here is my problem :</p> <p>I have an HTML table that I am generating from Javascript, this is fine and the table generates as expected with no problems.</p> <p>When the user clicks on a cell it will highlight that cell (or un-highlight if the cell is highlighted), this again works fine.</p> <p>We then needed the ability to drag over the cells (whilst the mouse is down) and highlight the cells they hovered, this I managed to do but it was not the best solution so it was asked if we could select a cell, then hover to another cell and all the cells in between become highlighted.</p> <pre><code>For example : Start Cell = Row 1, Cell 1 End Cell = Row 3, Cell 3 Highlighted Cells = R1C1, R1C2, R1C3, R2C1, R2C2, R2C3, R3C1, R3C2, R3C3. </code></pre> <p>I have managed to sort of get this solution to work, here is a <a href="http://jsfiddle.net/ujhUm/1/" rel="nofollow">JSFiddle</a> to show the solution, if you click on the first cell and hold the mouse down and drag to the last cell it works fine.</p> <p>My Problem is that if you drag from the last cell (bottom left) to the top cell (top right) the highlighting effect seems to stall randomly until you are on row 2 or 3.</p> <p>Is there any reason why this would be occurring? Is my code incorrect / inefficient for this?</p> <p>I've been stuck with this for sometime and can't seem to find any reason why it would be occurring.</p> <p>Any help is greatly appreciated.</p> <p>P.S. - This solution <strong>MUST</strong> be a fully Javascript solution, jQuery cannot be used for this solution unfortunately as we require this to be a single HTML File and must be possible to use without an Internet Connection.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload