Skip to content

Instantly share code, notes, and snippets.

@Macagare
Last active November 8, 2023 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Macagare/ec5b6aa25ff301184a1f to your computer and use it in GitHub Desktop.
Save Macagare/ec5b6aa25ff301184a1f to your computer and use it in GitHub Desktop.
shuffle divs inside a div container
$(function () {
var parent = $("#container");
var divs = parent.children();
while (divs.length) {
parent.append(divs.splice(Math.floor(Math.random() * divs.length), 1)[0]);
}
});
@socherbyc
Copy link

*shuffle divs via javascript and jQuery

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