Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- </head>
- <body>
- <canvas id="canvas" width="500" height="500">Canvas tag not supported!</canvas>
- <script>
- var b_canvas = document.getElementById("canvas");
- var b_context = b_canvas.getContext("2d");
- var x = 0;
- setInterval(function () {
- b_canvas.width = b_canvas.width;
- b_context.fillRect(x, 25, 150, 100);
- x++;
- b_context.fillRect(0, 0, 500, 2);
- b_context.fillRect(0, 0, 2, 500);
- b_context.fillRect(498, 0, 2, 500);
- b_context.fillRect(0, 498, 500, 2);
- }, 10);
- setInterval(function () {x = 0;}, 2000);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement