Sorry to highjack this, but Karl could you somehow describe exactly what
that function does, my js is pretty rusty but i would like to understand how
it works.
Thanks
---
Alexandru Dinulescu
Web Developer
(X)HTML/CSS Specialist
Expert Guarantee Certified Developer
XHTML:
I am wondering if it is possible to reorder a unordered list based on
the list items 'rel' attribute?
i have a list of items that change dynamically (its linked in with
google maps, the 'rel' attribute of the list item is updated with the
new distance from the google map marker icon when the
Something like this might work...
var items = $('li').get();
items.sort(function(a, b) {
var relA = +$(a).attr('rel');
var relB = +$(b).attr('rel');
if (relA relB) { return 1; }
if (relA relB) { return -1; }
return 0;
});
for (var i=0; i items.length; i++) {
3 matches
Mail list logo