function get_timer(){
//day
var day = parseInt (timer/(24*60*60*1000));
if(day < 10){
day ='0' + day;
}
day = day.toString();
//hour
var hour = parseInt (timer/(60*60*1000))%24;
if(hour < 10){
hour ='0' + hour;
}
hour = hour.toString();
//min
var min = parseInt (timer/(60*1000))%60;
if(min < 10){
min ='0' + min;
}
min = min.toString();
//seconds
var sec = parseInt (timer/(1000))%60;
if(sec < 10){
sec ='0' + sec;
}
sec = sec.toString();
if(min[1] == 9 && sec[0] == 5 && sec[1] == 9){
animation($("#min0"),min[0]);
}
else{
$("#min0").html(min[0]);
}
if(sec[1] == 9){
animation($("#sec0"),sec[0]);
}
else{
$("#sec0").html(sec[0]);
}
animation($("#sec1"),sec[1]);
setTimeout(get_timer,1000);
function animation(vibor,param){
vibor
.html(param)
.css({'marginTop':'-20px','opacity':'0'})
.animate({'marginTop':'0px','opacity':'1'});
}
get_timer();
}); //eror
-
Вопрос задан
-
234 просмотра