|
|
| (28 tussenliggende versies door 2 gebruikers niet weergegeven) |
| Regel 1: |
Regel 1: |
| | | {{Sjabloon:Lange spieker}} |
| <html>
| |
| <script>
| |
| var canvas = document.createElement('canvas');
| |
| | |
| canvas.id = "CursorLayer";
| |
| canvas.width = 1224;
| |
| canvas.height = 768;
| |
| canvas.style.zIndex = 8;
| |
| canvas.style.position = "absolute";
| |
| canvas.style.border = "1px solid";
| |
| | |
| | |
| var body = document.getElementsByTagName("body")[0];
| |
| body.appendChild(canvas);
| |
| | |
| cursorLayer = document.getElementById("CursorLayer");
| |
| | |
| console.log(cursorLayer);
| |
| | |
| // below is optional
| |
| | |
| var ctx = canvas.getContext("2d");
| |
| ctx.fillStyle = "rgba(255, 0, 0, 0.2)";
| |
| ctx.fillRect(100, 100, 200, 200);
| |
| ctx.fillStyle = "rgba(0, 255, 0, 0.2)";
| |
| ctx.fillRect(150, 150, 200, 200);
| |
| ctx.fillStyle = "rgba(0, 0, 255, 0.2)";
| |
| ctx.fillRect(200, 50, 200, 200);
| |
| </script>
| |
| </html>
| |