Código HTML :
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Título</title> <style type="text/css"> html, body{margin: 0;padding: 0;width: 100%;height: 100%;overflow: hidden;} </style> </head> <body onmousemove="c(event);" > <div class="contenedor"> <canvas id="myCanvas" height="1000" width="2000"> Your browser does not support the HTML5 canvas tag. </canvas> </div> </body> <script type="text/javascript"> var i = 0; function c(e){ var arr = []; var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); ctx.beginPath(); ctx.arc(e.pageX + Math.random() * 25,e.pageY + Math.random() * 25,Math.random() * 25,0,4*Math.PI); ctx.strokeStyle = "#" + Math.round(Math.random()*999999); ctx.stroke(); arr.push(ctx); } //EXECUTION </script> </html>
que genera circulos en lugares random de un html, siguiendo al mouse, ahora, me gustaria saber si hay alguna forma de ir borrando los que se quedan atras, apra que no quede un rastro interminable de circulos
