html5 canvas画布无法清除
<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>Document</title><style...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
body{
background: black;
}
#c1{
background: white;
}
</style>
<script>
window.onload = function(){
var oC = document.getElementById('c1');
var oGC = oC.getContext('2d');
var num = 0;
var num2 = 0;
var value = 1;
oGC.translate(100,100);
setInterval(function(){
num++;
oGC.save();//保存路径
oGC.clearRect(0,0,oC.width,oC.height);
if(num2 == 100){
value = -1;
}
else if(num2 == 0){
value = 1;
}
num2 += value;
oGC.scale(num2*1/50,num2*1/50)
oGC.rotate(num*Math.PI/180);
oGC.translate(-50,-50);
oGC.fillRect(0,0,100,100);
oGC.restore();//回复路径
},30);
};
</script>
</head>
<body>
<canvas id="c1" width="600" height="600">
</canvas>
</body>
</html>
当大小增加到100之后就没办法清除掉外层的黑块了,为什么会出现这种状况?求助 展开
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
body{
background: black;
}
#c1{
background: white;
}
</style>
<script>
window.onload = function(){
var oC = document.getElementById('c1');
var oGC = oC.getContext('2d');
var num = 0;
var num2 = 0;
var value = 1;
oGC.translate(100,100);
setInterval(function(){
num++;
oGC.save();//保存路径
oGC.clearRect(0,0,oC.width,oC.height);
if(num2 == 100){
value = -1;
}
else if(num2 == 0){
value = 1;
}
num2 += value;
oGC.scale(num2*1/50,num2*1/50)
oGC.rotate(num*Math.PI/180);
oGC.translate(-50,-50);
oGC.fillRect(0,0,100,100);
oGC.restore();//回复路径
},30);
};
</script>
</head>
<body>
<canvas id="c1" width="600" height="600">
</canvas>
</body>
</html>
当大小增加到100之后就没办法清除掉外层的黑块了,为什么会出现这种状况?求助 展开
推荐于2016-11-10
展开全部
for ($i=0; $i<count($values); $i++) {
$sql = "insert into customer (openid, opercode, text, time, worker) values
$stmt = $dbh->prepare( $sql );
$stmt->execute( array( ".$values[$i]." ) );
$rn = $stmt->rowCount();
echo "<script>alert();</script>";
}
$sql = "insert into customer (openid, opercode, text, time, worker) values
$stmt = $dbh->prepare( $sql );
$stmt->execute( array( ".$values[$i]." ) );
$rn = $stmt->rowCount();
echo "<script>alert();</script>";
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询