Skip to content

Instantly share code, notes, and snippets.

@garystorey
Created May 14, 2013 15:17
Show Gist options
  • Select an option

  • Save garystorey/5576754 to your computer and use it in GitHub Desktop.

Select an option

Save garystorey/5576754 to your computer and use it in GitHub Desktop.
reverse an unordered (or ordered list) with jQuery
var $sel = $("ul"),
list = $sel.find('li').get().reverse();
$sel.empty().append(list);
@garystorey
Copy link
Author

It would be nice to do this without removing from the list and use css transitions to "move" them into place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment