亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

想要根據框中鍵入的數字在canvas中循環畫圖,不知道為什么循環不了呢?

想要根據框中鍵入的數字在canvas中循環畫圖,不知道為什么循環不了呢?

qq_伽利略扭秤_0 2017-04-18 22:19:12
<!DOCTYPE?html?PUBLIC?"-//W3C//DTD?XHTML?1.0?Transitional//EN"?"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html?xmlns="http://www.w3.org/1999/xhtml"> <head> <meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"?/> <title>無標題文檔</title> <script?type="text/javascript"> function?block(){ ????var?height?=?document.myFrom.txtcount.value; ????var?c?=?document.getElementById("myCanvas"); ????var?cxt?=?c.getContext("2d"); ???? ?????for(i?=?0;?i?<?height;?i++){ ????????cxt.fillStyle="#FF0000"; ????????cxt.fillRect(0,0+i*150,150,75); ???????? ????????cxt.fillStyle="#ffffff"; ????????cxt.beginPath(); ????????cxt.arc(70,18+i*150,15,0,Math.PI*2,true); ????????cxt.closePath(); ????????cxt.fill(); ????} } </script> </head> <body> <from?name?=?"myFrom"> ????<input?type="text"?name="txtcount"/> ????<input?type="submit"?name?=?"Submit"?value="Go!"?/?onclick="block"> </from> <canvas?id="myCanvas"?width="150"?style="border:1px?solid?#c3c3c3;">Your?browser?does?not?support?the?canvas?element.</canvas> </body> </html>
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 2053 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號