下载或跟着老师敲的代码记得设置时间(选择未来四天内的某一个时间点)
//距离2016-10-21-18:47:52的倒计时
const endTime = new Date(2016,9,21,18,47,52);
//距离2016-10-21-18:47:52的倒计时
const endTime = new Date(2016,9,21,18,47,52);
2016-10-19
源代码有问题检查了好多次才改过来。
将rander函数中的renderDigit(marLeft,marTop,parseInt(hours/10),cxt);
改为renderDigit(marLeft,marTop,parseInt(hours%10),cxt);
否则会溢出
将rander函数中的renderDigit(marLeft,marTop,parseInt(hours/10),cxt);
改为renderDigit(marLeft,marTop,parseInt(hours%10),cxt);
否则会溢出
2016-10-14
for(var i=0;i<10;i++){
context.beginPath();
context.arc(50+i*100,180,40,0,2*Math.PI*(i-1)/10);
context.stroke();
context.closePath();
}
直接这样,就可以了嘛,不用把context.closePath();删掉,把他放在context.stroke();后面就行,不会封闭
context.beginPath();
context.arc(50+i*100,180,40,0,2*Math.PI*(i-1)/10);
context.stroke();
context.closePath();
}
直接这样,就可以了嘛,不用把context.closePath();删掉,把他放在context.stroke();后面就行,不会封闭