我编写了这段代码来从一系列dom元素中删除一个稀疏数组.当在一个维度中完成代码时,但是在2维中,它会失败.有什么我想念的吗?
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 }
Run Code Online (Sandbox Code Playgroud)