I wrote this code to scrape a sparse array from a series of dom elements. when done in one dimension the code works but in 2 dimensions it fails. Is there something i'm missing?
23 function initCellHover(){
24 $cells.each(function(){
25 var arrayX = $(this).position().left/cellWidth;
26 var arrayY = $(this).position().top/cellHeight;
27 var arrayValue = $(this);
28 cellLookup[arrayX][arrayY] = arrayValue;
29 });
30 }