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