aneObj.prototype.draw = function() {
ctx2.save();
ctx2.globalAlpha = 0.6;
ctx2.lineWidth = 20;
ctx2.lineCap = "round";
ctx2.stokeStyle = "purple";
for (var i = 0; i < this.num; i++) {
ctx2.beginPath();
ctx2.moveTo(this.x[i], canHeight)
ctx2.lineTo(this.x[i], canHeight - this.len[i])
ctx2.stroke();
};
ctx2.restore();
};
已解决,谢谢哦!
不好意思,ctx2.strokeStyle,刚我少写了字母e
ctx2.strokStyle, 注意你少写了字母 r