我正在尝试创建一个函数,该函数将在表中排列点,如图所示:
我需要修改的代码是:
var rowsCount = 7;
var heightTable = 700;
var rowHeight = 100;
//an array with divs with elements, every element has a top and left position
var arrayOfDivs = [({topPosition : 99, leftPosition: 100}),({topPosition : 150, leftPosition: 400}),({topPosition : 578, leftPosition: 10})];
//so here create a function that will create arrays = rowCount, so here we will need 7 arrays and arrange elements from arrayOfDivs into new arrays
function arrangeInNewArrays (rowsCont,heightTable,rowHeight) {
var j=0;
for i=0 {
if (arrayOfDivs.topPosition[0] > rowHeight*j < rowHeight){
var array+j = array+j+arrayOfDivs[i];
}else {
i++,j++
}
}
print arrayofDivs[i];
}
有什么建议么?我怎样才能按行排列点...
请帮我这样做///
代码:http: //jsfiddle.net/sYq9S/9/