在javascript中对一个对象数组进行排序
摘要:
function sort(photoes) { var temp, j; for (var i = 1; i < photoes.length; i++) { if (compare(photoes[i], photoes[i - 1]) == -1) { temp = photoes[i]; j = i - 1; do { photoes[j + 1] = photoes[j]; j--; } while (j > -1 && compare(temp, photoes[j]) == -1); photoes[j + 1] = temp; } //endif } 阅读全文
posted @ 2011-02-17 17:11
灵魂边缘
阅读(196)
评论(0)
推荐(0)
浙公网安备 33010602011771号