//画圆
function drawcircle(id,x,y,r){
var ca = document.getElementById(id);
var cans = ca.getContext("2d");
cans.globalCompositeOperation = "destination-out";
cans.beginPath();
cans.arc(x,y,r,0,Math.PI*2);
ca.style.display = ‘none’;
ca.offsetHeight;
ca.style.display = ‘inherit’;
cans.fillStyle="#000";
cans.fill();
}
这样可以解决。