March 12, 2012
Sorting Images by File Name
Question by user1259527
I want help arranging images. I have this table and I want the images to appear in a certain order, eg B A G D…. (going from left to right).
The code can be found here.
Answer by Starx
See this answer. This is what you might be asking.
I create a perfect modification of that function for you
function sorter(selector, order) {
selector.each(function() {
if(order) {
for(var i =0; i < order.length; i++){
$("#sorted").append($(this).children('img[id='+order[i]+']'));
}
}
});
}
sorter($("div"), ['a','c','d']);