Estoy creando un sitio web próximamente
<div class="countdown styled"></div>De este div, necesito un temporizador de cuenta regresiva. Así que utilicé el temporizador de cuenta regresiva predeterminado de jquery.countdown.js.
La interfaz de usuario viene correctamente y muestra segundos en 0 solamente.
¿Qué tengo que hacer para ejecutar un contador?
Estoy obteniendo el código Js en el archivo jquery.countdown.js
(function() { (function($) { $.countdown = function(el, options) { var getDateData, _this = this; this.el = el; this.$el = $(el); this.$el.data("countdown", this); this.init = function() { _this.options = $.extend({}, $.countdown.defaultOptions, options); if (_this.options.refresh) { _this.interval = setInterval(function() { return _this.render(); }, _this.options.refresh); } _this.render(); return _this; }; getDateData = function(endDate) { var dateData, diff; endDate = Date.parse($.isPlainObject(_this.options.date) ? _this.options.date : new Date(_this.options.date)); diff = (endDate - Date.parse(new Date)) / 1000; if (diff <= 0) { diff = 0; if (_this.interval) { _this.stop(); } _this.options.onEnd.apply(_this); } dateData = { years: 0, days: 10, hours: 10, min: 20, sec: 14, millisec: 10 }; $.countdown.defaultOptions = { date: "Dec 25, 2021 15:03:25", refresh: 1000, onEnd: $.noop, render: function(date) { return $(this.el).html("" + date.years + " years, " + date.days + " days, " + (this.leadingZeros(date.hours)) + " hours, " + (this.leadingZeros(date.min)) + " min and " + (this.leadingZeros(date.sec)) + " sec"); } }; $.fn.countdown = function(options) { return $.each(this, function(i, el) { var $el; $el = $(el); if (!$el.data('countdown')) { return $el.data('countdown', new $.countdown(el, options)); } }); }; return void 0; })(jQuery); }).call(this);Pero el contador no funciona. Solo viene la interfaz de usuario. Gracias por adelantado