canvas在不同浏览器出现的问题
fillRect方法在IE和谷歌的不同表现。待解决
function drawRec() {
var cas = document.getElementById('_rectangle');
if (cas.getContext) {
var ctx = cas.getContext('2d');
//画矩形
ctx.fillStyle = 'rgb(188,200,0)';
ctx.fillRect(0, 0, 80, 80);
ctx.fillStyle = 'rgb(200,0,0,0.5)';
ctx.fillRect(30, 30, 80, 80);
//绘制一个矩形的边框
ctx.strokeRect(0, 0, 150, 150);
//清除指定矩形区域,让清除部分完全透明。
ctx.clearRect(50, 50, 10, 10);
}
}