12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <!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();
- /* $("div").attr("id", function(){
- var a = 1, b=2;
- return a+b;
- });*/
- //alert($("div").attr("id"));
- $("#di").remove();
- }
- </script>
- </html>
|