/**
* @param {domArray}
* @param {config} an Object contains maxN, baseTop and baseLeft
* Author: asfman
**/
function autoPosition(domArray, config){
for(var i = 0; i < domArray.length; i++){
domArray[i].style.top = ((i - config.maxN < 0 ? i : (i - config.maxN) % config.maxN) * config.baseTop) + "px";
domArray[i].style.left = Math.floor(i / config.maxN) * config.baseLeft + "px";
}
}
posted on 2009-03-12 10:31
汪杰 阅读(223)
评论(0) 编辑 收藏 引用 所属分类:
javascript