jquery - How to call the javascript function one after the other with delay? -


here have javascript function iterates through array , appends image div.when last element in array reached, function invokes flip function scales div, , after 3 seconds function repeats. i.e 3 seconds can see flipped content, after 3 seconds continues again array iteration....

i have 6 set of same functions given below...for example flip-1, flip-2, flip-3 , on till flip-6. want is, want call flip-5 flip-1 completes 3 seconds of flip.... how can this?

function startslidecat1(started) {   (var = 0; < footwear.length; i++) {     var image = footwear[i][0];     imgslidercat1(image, / initial_del * 8000, == footwear.length - 1);   } };  function imgslidercat1(image, timeout, last) {   window.settimeout(function() {     document.getelementbyid('flip-1').style.display = 'none';     document.getelementbyid('category-1').style.display = 'block';     document.getelementbyid('category-1').innerhtml = "";     var product = document.getelementbyid('category-1');     var elem = document.createelement("img");     product.appendchild(elem);     elem.src = image;     if (last) {                     flip1();     }   }, timeout); } startslidecat1();  function flip1(){         $('#category-1').css('display', 'none');         $('.box-1').delay(100).css('display', 'block');     //$('#category-1').delay(100).addclass("closeover");      $('.box-1').addclass("opensesame");       settimeout(closeit, delay_time);     //flip2();   }  function closeit(){    // $('.box-1').addclass("closesesame");     //$('.box-1').removeclass("closesesame");          $('#category-1').addclass("opensesame");     settimeout(startslidecat1, 400);      } 

settimeout(flip5,3000); 

this call "flip5" function after 3 seconds ( = 3000ms).


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -