Pause in program
hi developers !
i need a pause in my program. but this does not work with
setTimeout (3000);
i want 4 images, and each of them should be visible for 1 or 2 seconds
this could not be so difficult damn :-)
3 Answers
-
Checkout the setTimeout and setInterval examples in the kitchen sink. You could nest the timeout commands for a small number of images, or use setInterval with a larger number.
This is psuedo code, but the setTimeout/Interval commands should be correct.
setTimeout(function(){ Show image1 setTimeout(function(){ Show image2 setTimeout(function(){ Show image3 setTimeout(function(){ Show image4 },2000); },2000); },2000); },2000);
picArray=["pic1", "pic2", ... "pic100"]; picNumber=0 var x=setInterval(function(){ Display picArray[picNumber] picNumber++; if (picNumber > picArray.length) { clearInterval(x); } }, 2000)
Hope this helps.
-
create the image named let's say img1, then try this:
setTimeout(function(){ img1.hide();}, 3000);
-
Thank you guys!!
I feel, this two answers, will guide me to the right direction !!
Thanks for your input !