title: How to do a slow pulse circle on javascript within a function?
body: <p>I have drew some circle functions in javascript and would like to add a function of slow pulsing effect to it. Below is my js code, can anyone help me please?</p>
  
  <p>Thanks!!!</p>
  
  <p>Karen x</p>
  
  <pre><code>   function newCircle1 (x,y){
  
              var ctx=canvas.getContext("2d");
  
              ctx.fillStyle="rgb(255,255,255,0.65)";
              ctx.beginPath();
              ctx.arc(x,y,10,0,2*Math.PI);
              ctx.fill();         
      }
  
              function newCircle2 (x,y){
  
              var ctx=canvas.getContext("2d");
  
              ctx.fillStyle="rgb(255,255,255)";
              ctx.beginPath();
              ctx.arc(x,y,5,0,2*Math.PI);
              ctx.fill();
          }
  
  
          function getMousePos(canvas,evt){
  
          var rect = canvas.getBoundingClientRect();
          return{
  
              x: evt.clientX - rect.left,
              y: evt.clientY - rect.top
          };
      }
  
          canvas.addEventListener('mousemove', function(evt){
              var mousePos = getMousePos (canvas,evt);
  
              newCircle1(mousePos.x, mousePos.y);
              newCircle2(mousePos.x, mousePos.y);     
  
          }, false);
  }
  </code></pre>