问答详情
源自:2-3 线条组成的图形和beginPath

为什么第二个圆的颜色显示不出来

请问我第二个圆的填充色怎么显示不出来,代码是哪里出错了,谢谢


 window.onload = function(){


        var canvas = document.getElementById("cnavas");

        var cxt = canvas.getContext('2d');


        canvas.width =440;

        canvas.height =90;


        cxt.strokeStyle = "#ecebeb";

        cxt.moveTo(40,42);

        cxt.lineTo(220,42);

        cxt.lineWidth = 5;

        cxt.stroke();


        cxt.beginPath();

        cxt.fillstyle = "blue";

        cxt.arc(45, 45, 25, 0, 2*Math.PI, false);

        cxt.fill();

        cxt.closePath();

}


提问者:qq_遺忘的激情_0 2016-10-12 11:22

个回答

  • 墨小良
    2016-10-13 03:07:43
    已采纳

    fillStyle 的 S要大写。