Thank you so much to all of you. Today i am trying to create a countdown and again reset this at 15min interval. I am using these code in javascript.
Javascript------
<script type="text/javascript">
$(document).ready(function(){
setInterval(function(){
countdown();
}, 54000);
})
var mins = 15;
var secs = mins * 60;
function countdown() {
setTimeout('Decrement()',1000);
}
function Decrement() {
if (document.getElementById) {
minutes = document.getElementById("minutes");
seconds = document.getElementById("seconds");
if (seconds < 59) {
seconds.innerHTML = secs;
} else {
minutes.innerHTML = getminutes();
seconds.innerHTML = getseconds();
}
secs--;
if(secs > 0)
{
setTimeout('Decrement()',1000);
}
}
}
function getminutes() {
// minutes is seconds divided by 60, rounded down
mins = Math.floor(secs / 60);
return mins;
}
function getseconds() {
// take mins remaining (as seconds) away from total seconds
remaining
return secs-Math.round(mins *60);
}
</script>
Call this countdown function on page load
<body onload="countdown();">
TIME LEFT: <label id="minutes"></label> : <label id="seconds"></label>
</body>
As you can see that this countdown start on page load and i tried to restart the countdown on after 15min of time interval....
But i want to run this countdown on a 15min interval and keep continue on page refresh..
Please correct this code send me another reference .