I'm trying to shuffle the order of a jQuery selection without shuffle the elements in the DOM.
I need to shuffle the selection to add a class to each element in random order, this is how my code should look:
$(".item").shuffle().each(function (i, element) {
$(element).delay(i * 100).queue(function (next) {
$(this).addClass("shown");
next();
});
});
Can someone help me finding the shuffle()
function I need?