I am using the jQuery Keith-Wood plugin for showing one countdown timer on my page, and it works fine.
Now I want to display multiple countdowns, but it doesn't seem to work (it works only for the first element).
Here is what i do:
<? foreach ($sales as $sale): ?>
<script>
$(function () {
var austDay = new Date();
austDay = new Date(<?php echo date('Y', strtotime($sale->end))?>,<?php echo (date('m', strtotime($sale->end))-1)?>,<?php echo date('d-1', strtotime($sale->end))?>,<?php echo date('h', strtotime($sale->end))?>,<?php echo date('i', strtotime($sale->end))?>,<?php echo date('s', strtotime($sale->end))?>);
$('#defaultCountdown').countdown({until: austDay, format: 'dHMS'});
});
</script>
<div id="defaultCountdown"></div>
Any idea about how could I could make it work for each sale data? I mean, how can I make it multiple and working?