Skip to content

Instantly share code, notes, and snippets.

@chancesmith
Last active October 12, 2016 17:03
Show Gist options
  • Select an option

  • Save chancesmith/b70a38b66a0b33e05d5f95a2e544477b to your computer and use it in GitHub Desktop.

Select an option

Save chancesmith/b70a38b66a0b33e05d5f95a2e544477b to your computer and use it in GitHub Desktop.
Float specific li items to the top of a list
// list featured collections in opposite order desired
var featured = ['Metal Signs',
'Canvas Prints',
'Gallery Prints'];
var ul = $(".list");
for(var i = 0; i < featured.length; i++){
ul.prepend( $( ".list li:contains('" + featured[i] + "')" ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment