1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <!DOCTYPE html>
- <html>
- <head lang="en">
- <meta charset="UTF-8">
- <title>Canvas Demo</title>
- <script src="../../../lib/jquery/jquery.min.js"></script>
- <script>
- var test = "test";
- function setId(){
- return "testSetId";
- }
- </script>
- </head>
- <body>
- <canvas id="cv"></canvas>
- <input type="hidden" id="">
- <div id="di">sss</div>
- </body>
- <script>
- window.onload = function(){
- var canvas = document.getElementById("cv");
- var ctx = canvas.getContext("2d");
- //ctx.setLineDash([1,1]);
- ctx.beginPath();
- ctx.moveTo(100, 100);
- //ctx.lineWidth = 0.5;
- ctx.strokeStyle = "gray";
- ctx.lineTo(100, 120);
- ctx.lineTo(120, 120);
- ctx.lineTo(120, 100);
- ctx.lineTo(100, 100);
- ctx.stroke();
- ctx.beginPath();
- ctx.strokeStyle = "black";
- ctx.moveTo(105, 110);
- ctx.lineTo(115, 110);
- ctx.stroke();
- ctx.beginPath();
- ctx.moveTo(100, 50);
- ctx.strokeStyle = "gray";
- ctx.lineTo(100, 70);
- ctx.lineTo(120, 70);
- ctx.lineTo(120, 50);
- ctx.lineTo(100, 50);
- ctx.stroke();
- ctx.beginPath();
- ctx.strokeStyle = "black";
- ctx.moveTo(105, 60);
- ctx.lineTo(115, 60);
- ctx.moveTo(110, 55);
- ctx.lineTo(110, 65);
- ctx.stroke();
- $("#di").remove();
- }
- </script>
- </html>
|