I have a jsfiddle here - http://jsfiddle.net/5z2vu47a/
It's a simple timer that should change text that taken from and array
The timer only works once.
Why does the timer not continue to work.
var name_arr = ['learn', 'product', 'buying', 'selling', 'marketing', 'managing', ];
var counter = 0;
function names(){
alert(counter);
$('.text p').text(name_arr[counter]);
counter++;
alert(counter);
}
setTimeout(names, 1000);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…