Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
ul#myCounter li { display: inline-block; }
</style>
</head>
<body>
<ul id="myCounter">
<li><span class="hours"></span> :</li>
<li><span class="minutes"></span> :</li>
<li><span class="seconds"></span></li>
</ul>
<script src="https://code.jquery.com/jquery-2.2.0.min.js"></script>
<script src="jquery.countdown.js?v=1.0.0.0"></script>
<script type="text/javascript">
var d = new Date();
var month = d.getMonth()+1;
var day = d.getDate();
var year = d.getFullYear();
var day_in_week = d.getDay();
var hour = (day_in_week == 5 ? 14-1 : 17-1);
var minute = 30;
var second = 00;
var s1 = '/';
var s2 = ':';
var output = month+s1+day+s1+year+ ' ' +hour+s2+minute+s2+second;
$('#myCounter').countdown({
date: output
}, function () {
alert('Go home now...you must be very tired!');
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment