问答详情
源自:8-1 阴影

我的阴影怎么出不来效果啊

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>文字渲染</title>

<script type="text/javascript">

window.onload=function()

{

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

canvas.width=800;

canvas.height=800;


var context=canvas.getContext("2d");

//绘制阴影


context.fillStyle="#058";


context.ShadowColor="gray";

context.shadowOffsetX=20;

context.shadowOffsetY=20;

context.shadowBlur=5;

context.fillRect(100,500,300,300);

}

</script>

</head>

<body>

<canvas id="canvas" style="border:1px solid #aaa;display:block;margin:50px auto;"></canvas>

</body>

</html>


提问者:青墨 2015-03-25 20:42

个回答

  • kittywei
    2015-04-15 12:30:57

    亲,context.ShadowColor="gray"; 这句里面ShadowColory的s应该是小写 ==> shadowColor