JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<link rel="stylesheet" href="http://identidades.pt/css/style.css">
<div class="productFull">
<div class="proTiming">
<div id="data_exptag0" class="data_exptag" style="display: none">
<div id="diatag0">05</div>
<div id="mestag0">03</div>
<div id="anotag0">2014</div>
<div id="horatag0">00</div>
<div id="minutotag0">00</div>
</div>
<img src="http://www.identidades.pt/images/clock-icon.png" width="15" height="20">
<div id="countDowntag0"><span><strong></strong><span> Days | <span><strong></strong></span> Hours | <span><strong></strong></span> Minutes</span>
</span>
</div>
</div>
</div>
<div class="productFull">
<div class="proTiming">
<div id="data_exptag1" class="data_exptag" style="display: none">
<div id="diatag1">31</div>
<div id="mestag1">01</div>
<div id="anotag1">2014</div>
<div id="horatag1">23</div>
<div id="minutotag1">52</div>
</div>
<img src="http://www.identidades.pt/images/clock-icon.png" width="15" height="20">
<div id="countDowntag1"><span><strong></strong><span> Days | <span><strong></strong></span> Hours | <span><strong></strong></span> Minutes</span>
</span>
</div>
</div>
</div>
JavaScript
var montharray = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
jQuery.fn.countdown = function (yr, mes, d, h, m, s) {
$that = $(this);
var delta = 0;
var start = function (yr, mes, d, h, m, s) {
theyear = yr;
themonth = mes;
theday = d;
thehour = h;
theminutes = m;
theseconds = s;
var today = new Date();
var todayy = today.getYear();
if (todayy < 1000) todayy += 1900;
var todaym = today.getMonth();
var todayd = today.getDate();
var todayh = today.getHours();
var todaymin = today.getMinutes();
var todaysec = today.getSeconds();
var todaystring = montharray[todaym] + " " + todayd + ", " + todayy + " " + todayh + ":" + todaymin + ":" + todaysec;
var futurestring = montharray[mes - 1] + " " + d + ", " + yr + " " + thehour + ":" + theminutes + ":" + theseconds;
dd = Date.parse(futurestring) - Date.parse(todaystring) + delta;
dday = Math.floor(dd / (60 * 60 * 1000 * 24) * 1);
dhour = Math.floor((dd % (60 * 60 * 1000 * 24)) / (60 * 60 * 1000) * 1);
dmin = Math.floor(((dd % (60 * 60 * 1000 * 24)) % (60 * 60 * 1000)) / (60 * 1000) * 1);
dsec = Math.floor((((dd % (60 * 60 * 1000 * 24)) % (60 * 60 * 1000)) % (60 * 1000)) / 1000 * 1);
if (dday < 0 && dhour < 0 && dmin < 0 && dsec < 1) {
alert("ended");
return;
} else {
$that.html("<span><strong>" + dday + "</strong><span> Days | " + "<span><strong>" + dhour + "</strong></span> Hours | " + "<span><strong>" + dmin + "</strong></span> Minutes");
}
setTimeout(function () {
start(theyear, themonth, theday, thehour, theminutes, theseconds);
}, 1000);
}
return {
start: function () {
start(yr, mes, d, h, m, s);
},
addTime: function (ms) {
delta += ms;
...