//Countdown 8 minutes varGettime=sessionstorage.getitem ("Zicetime"); varIntdiff = parseint (GetTime * 60);//Countdown total number of seconds functionTimer (Intdiff) {Window.setinterval (function(){ varDay=0, hour=0, Minute=0, Second= 0;//Time Default Value if(Intdiff > 0) { Day= Math.floor (Intdiff/(60 * 60 * 24)); Hour= Math.floor (Intdiff/())-(Day * 24); Minute= Math.floor (INTDIFF/60)-(Day *)-(Hour * 60); Second= Math.floor (Intdiff)-(Day *)-(Hour *)-(MINUTE * 60); } if(minute <= 9) minute = ' 0 ' +minute; if(Second <= 9) Second = ' 0 ' +second; //$ (' #day_show '). HTML (day+ "Day");$ (' #hour_show '). html (' <s id= ' h ' ></s> ' +hour+ ')); $(' #minute_show '). html (' <s></s> ' +minute+ '); $(' #second_show '). html (' <s></s> ' +second+ ' s '); Intdiff--; //if (intdiff==50) { //alert (123) // }}, 1000); } $(function() {timer (Intdiff); });
JS Implementation Countdown