Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimer.js
More file actions
Latest commit
39 lines (25 loc) · 1017 Bytes
/
Copy pathtimer.js
File metadata and controls
39 lines (25 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
vardate=newDate(2013,10,20,23,3,0,0);//çàäàåì äàòó ìåñÿö ñ 0
varnow=newDate();
vardateDifferenceMS=(date.getTime()-now.getTime());
if(dateDifferenceMS>0)
{
setInterval(step,1000);
}
var$timer=$(".timer");
var$timerDay=$timer.find(".days>p");
var$timerHour=$timer.find(".hours>p");
var$timerMinute=$timer.find(".minutes>p");
var$timerSecond=$timer.find(".seconds>p");
functionstep()
{
now=newDate();
dateDifferenceMS=(date.getTime()-now.getTime());
varcurrentDay=Math.floor(dateDifferenceMS/86400000);
varcurrentHour=Math.floor((dateDifferenceMS-(currentDay*86400000))/3600000);
varcurrentMinute=Math.floor((dateDifferenceMS-(currentDay*86400000)-(currentHour*3600000))/60000);
varcurrentSecond=Math.floor(dateDifferenceMS/1000-(currentDay*86400)-(currentHour*3600)-(currentMinute*60));
$timerDay.text(currentDay);
$timerHour.text(currentHour);
$timerMinute.text(currentMinute);
$timerSecond.text(currentSecond);
}