<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style>
body{
    background:pink;
    }
#c1{
    background:white;
    }    


</style>

<script>
window.onload = function ()
{
    var oc = document.getElementById('c1');
    var ogc = oc.getContext('2d');
    var num = 0;
    
    setInterval(function (){
        num++;
        ogc.clearRect(0,0,oc.width,oc.height);
        ogc.fillRect(num,num,100,100);
        },20)
    
    
}
</script>
</head>

<body>
    <canvas >
        <span>请升级您的浏览器</span>
    </canvas>
</body>
</html>

 

相关文章:

  • 2022-02-07
  • 2021-06-08
  • 2022-12-23
  • 2021-05-19
  • 2022-12-23
  • 2022-12-23
  • 2021-10-15
  • 2022-12-23
猜你喜欢
  • 2021-06-19
  • 2022-12-23
  • 2022-12-23
  • 2021-08-05
  • 2021-08-10
  • 2022-12-23
  • 2021-12-06
相关资源
相似解决方案