0
我试图让我的应用程序中使用this jQuery plugin的某些定时条目的countup定时器,但它似乎只是Opera的实现......所有其他浏览器给我NaN:NaN:NaN
其中定时器应该是。jQuery countup定时器不能正常工作
我用这个代码:
{% for entry in today %}
<tr>
<td>{{ entry.description }}</td>
<td>{{ entry.start_time|date:"d M Y h:i a" }}</td>
<td>
{% if entry.end_time %}
{{ entry.end_time|date:"d M Y h:i a" }}
{% else %}
<a href="{% url updateEntry entry.id %}">In Progress</a>
{% endif %}
</td>
<td>
{% if entry.end_time %}
{{ entry.hours }}
{% else %}
<script type="text/javascript">
$(function() {
var startTime = new Date("{{ entry.start_time }}");
$('#sinceStart').countdown({since: startTime, compact: true,
format: 'HMS', description: ''});
});
</script>
<div id="sinceStart" class="countdown"></div>
{% endif %}
</td>
</tr>
{%ENDFOR%}
为start_time
变量使用now()
功能设置。然而,我注意到的一件事是,之前,计时器并没有在Opera上工作......然后我修改了代码以使其具有now().replace(microsecond = 0)
,并且它适用于一个浏览器。
有没有人有解决方案让脚本在其他浏览器上工作?