码迷,mamicode.com
首页 > 其他好文 > 详细

canvas光晕

时间:2015-08-27 21:06:46      阅读:498      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

 

 1 <!DOCTYPE html>
 2 <html>
 3     <head>
 4         <meta charset="utf-8">
 5         <title></title>
 6         <script type="text/javascript">
 7             function draw(id){
 8                 var convas = document.getElementById(id);
 9                 if(canvas == null){
10                     return false;
11                 }
12                 var context = canvas.getContext(2d);
13                 context.fillStyle = #eeeeff;
14                 context.fillRect(0,0,400,300);
15                 for(var i=0;i<10;i++){
16                     context.beginPath();
17                     context.arc(i*25,i*25,i*10,0,Math.PI*2,true);
18                     context.closePath();
19                     context.fillStyle = rgba(255,0,0,0.25);
20                     context.fill();
21                 }
22             }
23         </script>
24     </head>
25     <body onload="draw(‘canvas‘);">
26         <canvas id="canvas" width="400" height="300"></canvas>
27     </body>
28 </html>

 

canvas光晕

标签:

原文地址:http://www.cnblogs.com/staven/p/4764216.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!