M.O.S. Studios Posted June 18, 2010 Share Posted June 18, 2010 here is my function function runAccordion(){ var e=document.getElementsByName('overflow_remove'); for(var i=0; i<e.length; i++){ e[i].style.overflow="hidden"; } var nID = "Accordion_" + document.getElementById('season_select').options[document.getElementById('season_select').selectedIndex].value; if(openAccordion == nID) nID = ''; setTimeout("animate(" + new Date().getTime() + "," + TimeToSlide + ",'" + openAccordion + "','" + nID + "')", 33); openAccordion = nID; for(var i=0; i<e.length; i++){ e[i].style.overflow="auto"; } } </script> Basically i want a time delay added before that last 'for()' loop how would i do that? Link to comment https://forums.phpfreaks.com/topic/205177-time-delay-within-a-function/ Share on other sites More sharing options...
cags Posted June 19, 2010 Share Posted June 19, 2010 I'm a complete JS novice, but the only way I can think of is to move the for loop to another function and use setTimeout to call that function. Link to comment https://forums.phpfreaks.com/topic/205177-time-delay-within-a-function/#findComment-1074334 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.