Hi, I have a simple full width slideshow (project images), which i want to start on a random slide each time the page is reloaded.
at the moment I have my element hidden on load, then using following code
let rnd = Math.floor(Math.random() * 8); $w('#fullWidthSlides1').changeSlide(rnd); $w('#fullWidthSlides1').show();
The slideshow always lands on the first index, then changes randomly.
I thought using show(); after changing to random index would work, but still lands on first item.
any help appreciated!
I have exactly the same problem.
I have random numbers, but at the beginning it always shows the same first slide. After that it is working. Another issue I have: The first slide (whatever it is) does sometimes not show the image I added, but when I switch to the second slide and then back to the first one the image is visible. Just the initial state is sometimes not working correctly. Any help?
@J. D. Good day, I am new to corvid wix coding. I applied the first promise "then" block and my slideshow starts a random image but it proceeds sequentially. is there any way to change that sequential order to random and make it repeat? thanks in advance
You can add a short delay:
$w.onReady(function () { let rnd = Math.floor(Math.random() * 8); $w('#fullWidthSlides1').changeSlide(rnd); setTimeout(() => {$w('#fullWidthSlides1').show();}, 100) });