Team:ETH Zurich/labblog/buttons
From 2014.igem.org
(Difference between revisions)
Line 19: | Line 19: | ||
$(document).ready(function() { | $(document).ready(function() { | ||
$('.link-sort-list').click(function(e) { | $('.link-sort-list').click(function(e) { | ||
- | + | $("#sort-list article").sort(function (a, b) { | |
- | + | return parseInt(a.id) > parseInt(b.id); | |
- | + | }).each(function(){ | |
- | + | var elem = $(this); | |
- | + | elem.remove(); | |
- | + | $(elem).appendTo("#sort-list"); | |
- | + | }) | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
e.preventDefault(); | e.preventDefault(); | ||
}); | }); |