畫(huà)直線部分有完整代碼么
<!DOCTYPE html>
2 <html lang='zh-cn'>
3 <head>
? ?4 <title>Insert you title</title>
? ?5 <meta name='description' content='this is my page'>
? ?6 <meta name='keywords' content='keyword1,keyword2,keyword3'>
? ?7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
? ?8 <link rel='stylesheet' type='text/css' href='./css/index.css' />
? ?9 <script type='text/javascript' src='./js/jquery-1.12.1.min.js'></script>
? ?10 <style type='text/css'>
? ? </style>
? ?</canvas>
? ?23 <script>
? ? window.download=funcation(){
? ? var canvas=document.getElementById("canvas");
? ? ? ?25canvas id="canvas"
canvas.width=1024;
? ? ? ? ? ?canvas.height=768;
? ? ? ? ? ?var context=canvas.getContext('2d')
? ? ? ? ? ?context.moveTo(100,100)
? ? ? ? ? ?context.lineTo(700,700)
? ? ? ? ? ?context.linewith=5;//線條寬度為5
context.strokestyle="#005588"http://主要指線條顏色
context.stroke()
? ? ? ?}
? ?88 </script>
? ?89 </head>
90 <body>
91 ? ? <canvas id='can' width='500' height='500'>您的瀏覽器版本過(guò)低,請(qǐng)升級(jí)您的瀏覽器...</canvas>
92 </body>
93 </html>