Sort a jQuery selection 

Joined:
02/21/2009
Posts:
172

July 29, 2014 10:09:55    Last update: July 29, 2014 10:09:55
To sort a selected list of divs by vertical position:
$('div.container').sort(function(a, b) { return $(a).position().top - $(b).position().top })
Share |
| Comment  | Tags