[CMS] Random sorting

Hey @discovoador @buntestrahlen @tmfukushima @mietlicki @perkristian & @davidvm you can achieve this by adding in the following script (replace the “listitemclassname” with the class name which you give your list items):

    <script> var cards = $(".listitemclassname");
for(var i = 0; i < cards.length; i++){
    var target = Math.floor(Math.random() * cards.length -1) + 1;
    var target2 = Math.floor(Math.random() * cards.length -1) +1;
    cards.eq(target).before(cards.eq(target2));
} </script>

Here’s an example:
http://flow-in.webflow.io/

Here’s the Webflow Read-Only link: https://preview.webflow.com/preview/flow-in?preview=99d20c3007c32ab09ef1da4455a8de8c

Feel free to ask any questions. :slight_smile: Have fun!

5 Likes