<script>
function loading(t) {
var c=document.getElementById("myCanvas");
var cxt=c.getContext("2d");
cxt.clearRect(0,0,c.width,c.height);
cxt.lineWidth='8';
cxt.strokeStyle="#ee91e7";
cxt.beginPath();
cxt.arc(50,50,30,t*Math.PI/5,t*Math.PI/5+2/3*Math.PI,true);
cxt.stroke();
cxt.strokeStyle="#ee7980";
cxt.beginPath();
cxt.arc(50,50,15,-t*Math.PI/5,-t*Math.PI/5-2/3*Math.PI,false);
cxt.stroke();
}
var c=0;
var tt;
function timedCount() {
// document.getElementById('txt').value=c
c=c+1
// console.log(c);
loading(c);
tt=setTimeout("timedCount()",80);
}
function timeDown() {
clearTimeout(tt);
}
</script>
canvas环状加载图案
最新推荐文章于 2024-01-03 00:00:00 发布