Hi,
So I have this piece of code which I wish to run 5 times:
$w("#repeater1").hide('slide', imout)
$w("#myDataset").next()
setTimeout(() => {
$w("#repeater1").show('slide', waitin)
}, 1000)
I could enter it 5 times, but isn’t there a solution?
And also, I have a code which I wish to repeat forever. Is this possible?
Thanks, would really help!
J.D
2
try:
function myFunction(){
$w("#repeater1").hide('slide', imout);
$w("#myDataset").next();
setTimeout(() => {
$w("#repeater1").show('slide', waitin);
}, 1000)
}
for(let i = 0; i < 5; i++) {myFunction();}
Shan
3
Or try duplicating the page 5 times.
The 5th page you duplicate will automatically run the code 5 times.
This is a new feature or bug (however you want to call it)
J.D
4
. (But really Shan, some people might think you’re serious and not joking…)
Shan
5
FYI: I’m just kidding (or maybe not)
Its best you follow JD’s above given solution https://www.wix.com/corvid/forum/main/comment/5cea9dd01d1354015ac98c7b
Lol, no, I’m not that stupid.
Does anyone also know how I can loop/repeat something forever?
J.D
9
You can use the setInterval() method :
setInterval(() => {
// Put the code you want to run here
}, 1000)//time in milliseconds. In this example every 1 second