English 中文(简体)
jj 查询未正确计数的倒计时
原标题:jQuery countdown not counting down correctly

嘿,我把所有的代码都贴在倒计时器上。这里的 JSFdiddle 页面上有:http://jsfiddle.net/QVwGt/

如您在该页面上所见,计时器的起始时间(以秒计)为 95 ,然后是 94、93、92、91、90、85、84、83、82、81、80、75、74等

它应该从“坚固”59、58、57“/强”开始,一直到“坚固”00/强”。当它还剩下三十天时,它曾经这样做,但自从它进入2位数的天数后,它就开始这样做,我仔细查看代码,但找不到问题的根源。

就目前而言,即使从95开始,它也跟在59秒秒的速度(观察计算机钟手)。但是从95:o开始,它看起来不怎么好。

任何帮助都大有助于解决这个问题!

最佳回答
digits[c].__max = ((c-1) % 2 == 0) ? 5: 9;

你在这里评论了正确的代码

digits[c].__max = (c % 2 == 0) ? 5: 9;

http://jsfiddle.net/QVwGt/2/" rel="nown" >http://jsfiddle.net/QVwGt/2/

基本上,C就是你的循环器。在这种情况下,你正在寻找第二位数,最多9岁,第一位数,最多5岁。记住,你的循环器以0为基础,你又在思考一个基于1。

换句话说, 0% 2 = 0 = 0 和 1% 2 = 2 = 0 < code > = 0 < code > = 2 = 0 < code > 和 < code> 2% = 2 = 0 < code >

写成这样会更清楚些:

digits[c].__max = ((c + 1) % 2 == 0) ? 9: 5;
问题回答

暂无回答




相关问题
Mysql compaire two dates from datetime?

I was try to measure what is faster and what should be the best way to compare two dates, from datetime record in MySql db. There are several approaches how to grab a date from date time, but I was ...

iPhone Date Picker rolls over to 2010 on December 27th?

So I implemented a UIDatepicker in one of my applications for scheduling and autodialing teleconferences... everything is pretty much ready to go except, while testing I noticed that when the date ...

Convert date Python

I have MMDDYY dates, i.e. today is 111609 How do I convert this to 11/16/2009, in Python?

specifying date format when using $form->inputs() in CakePHP

I am wondering if there is a way to specify the date format in the forms created using CakePHP s $form->inputs(); Please note that this is not the individual $form->input() but instead $form->inputs() ...

NSDateFormat, super simple! Where am I screwing up?

Ok, this is really simple, maybe I m a getting a bit burnt out, but seems like it should work, Query XML feed, put out date string, format, display in a cell. The issue is I m a getting a NULL ...

sqlite writing a date into an email

I am exporting a date value from sqlite and placing it into an email. The date appears like this 279498721.322872 I am using Objective C in an Iphone App. Does anyone know how to make this export ...