Multiple Slider Independent Random Start

I’m working on a site that has three sliders that need to independently start on a random slide. Using the code below from this thread works in starting on a random slide, but it runs the same slide on each slider, even though each slider has different slides.

<script>
  $(".mask").append($(".mask").children().sort(function () {
    return Math.random() - 0.5;
}));
</script>

I’ve tried several solutions to no avail – giving each mask different class names, combo-classes, etc. I’m currently running this code, which is having the same original issue:

<script>
  $(".mask,.platinum").children().sort(function () {
    return Math.random() - 0.5;
}));
</script>

<script>
    $(".mask,.gold").children().sort(function () {
    return Math.random() - 0.5;
}));
</script>

<script>
    $(".mask,.silver").children().sort(function () {
    return Math.random() - 0.5;
}));
</script>

When I ran it with only the (“.mask,.platinum”) script it worked on that slider, but duplicating it with the other combo-classes brought back the same issue – all sliders running the same slides.


Read-Only Link: Webflow - Stay Positive News