怎么用数组遍历填写钟表的时钟和分钟
function drowHour(h,m) {
cxt.save();
cxt.beginPath();
var rad = 2 * Math.PI / 12 * h;
var mrad = 2 * Math.PI / 12 / 60 * m;
cxt.rotate(rad + mrad);
cxt.moveTo(0,10 );
cxt.lineTo(0,- r/2);
cxt.lineWidth = 6;
cxt.lineCap = "round";
cxt.stroke();
cxt.restore();
}
function drowMinits(m) {
cxt.save();
cxt.beginPath();
var rad = 2 * Math.PI / 60 * m;
cxt.rotate(rad);
cxt.moveTo(0,10);
cxt.lineTo(0,- r + 30);
cxt.lineWidth = 3;
cxt.lineCap = "round";
cxt.stroke();
cxt.restore();
}
借鉴Silva Zhou老师的上课代码