已采纳回答 / 慕粉15527929895
<...code...>function render(cxt){ //render函数头里面忘写形参cxt了 var hours = 12; var minutes = 34; var seconds = 56; renderDigit(0,0,parseInt(hours/10),cxt);}
2016-06-13
已采纳回答 / Dling
<...code...><...code...>为什么会有两个draw()函数?把draw(id) 改个名字就出来了 drawCanvas(id) <...code...><...code...>
2016-05-24
已采纳回答 / lemnaceae
1、setInterval()使用的位置不对,应该放在你的h1,h2等算出来之后,不然你使用setInterval()时调用render()后调用draw()时,h1、h2等参数是属于未定义的,也就是num是未定义的,所以digit[num].length会报错;2、你要确保var oTime=new Date(2016,4,14,0,0,0);中oTime的时间要在当前时间nTime之后,不然相减之后为负值,后面使用的时候索引越界,digit[num].length也会报错;3、注意两个时间之间不要相差...
2016-05-12