I\'m trying to make a multi-countdown on a page, which looks like :
|
相关标签:
-
2021-01-28 04:31
$(document).ready(function(){
$('tr[id]').each(function () {
var $this = $(this);
var count = parseInt($this.attr("id"));
countdown = setInterval(function(){
$('.remain', $this).html(count + " seconds remaining!");
if (count-- == 0) {
//do something
clearInterval(countdown);
}
}, 1000);
});
});
Try it here : http://jsfiddle.net/moeishaa/PwG45/