The following code doesn't work:
$(".countdown").circularCountdown({
startDate:$(this).attr('data-start'),
endDate:$(this).attr('data-end'),
timeZone:$(this).attr("timezone")
});
The one below works fine,
$(".countdown").circularCountdown({
startDate:$(".countdown").attr('data-start'),
endDate:$(".countdown").attr('data-end'),
timeZone:$(".countdown").attr("timezone")
});
I don't get it, doesn't the $(this) reference ".countdown" since I'm calling the function on this element? Could someone please help me out?
Because this
does not refer to the countdown
so one solution is to use each()
$(".countdown").each(function () {
$(this).circularCountdown({
startDate: $(this).attr('data-start'),
endDate: $(this).attr('data-end'),
timeZone: $(this).attr("timezone")
});
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With