I want to make a timer in jQuery, I want change the value of span each second I make like this, but it delay is not working.
function startTimer(daysRemain,hoursRemain,minutesRemain,secondsRemain){
while(secondsRemain < 60){
secondsRemain++;
$("span.secondRemain").delay(1000).text(secondsRemain); //change value of seconds each one second
// I try this way too!
/* setTimeout(function(){
$("span.secondRemain").text(secondsRemain);
},1000);*/
}
delayis only for the fx queue.A standard timer is as follows
http://jsfiddle.net/J9Zwa/