I used this code to let my slideshow start with a random image within the slides;
$w.onReady(function () { let rnd = Math.floor(Math.random() * 7); $w("#slideshow1").changeSlide(rnd) .then( (newSlide) => { $w('#slideshow1').show() } ); });
It works fine except the next image is not random but rather sequential ( the next slide in the list) I am a novice where coding is concerned and was wondering what help can be offered to allow this random function in the slideshow. thanks in advance
Wrap it under a setInterval() function
$w.onReady(function () { setInterval( () => { let rnd = Math.floor(Math.random() * 7) + 1 $w("#slideshow1").changeSlide(rnd); }, 3000); //3000 milliseconds a.k.a. 3 seconds });
& disable auto slide