Reputation: 1
Why won't this work in IE? I'm using the countdown plugin from Keith Wood, updated the plugin and JQuery. All timers show 00:00 in IE and only the first timer will display.
<script type = "text/javascript">
$(function() {
var i = 0;
$('.countdown').each(function() {
var year = $(this).attr('yr');
var month = $(this).attr('mth') - 1;
var day = $(this).attr('day');
var hour = $(this).attr('hr') - 3;
var minute = $(this).attr('min');
var second = $(this).attr('sec');
var ends = new Date();
ends = new Date(year, month, day, hour, minute, second);
$('#countdown_' + i).countdown({until: ends, format: 'MS', compact: true});
i++;
console.log("Countdown!");
});
});
</script>
Upvotes: 0
Views: 916
Reputation: 50728
You are subtracting the hour:
var hour = $(this).attr('hr') - 3;
I believe, from the example I see, that using countdown the hour must be greater than the current time. That would make it less than the current date, and therefore always zero. Try adding 3 to verify.
Upvotes: 1