第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定

為什么renderDigit 無定義? 求大神解答

<!DOCTYPE html>
<html>
?? ?<head>
?? ??? ?<meta charset="utf-8">
?? ?<title></title>
?? ??? ?<style>
?? ??? ??? ?#canvas{
?? ??? ??? ??? ?border: 1px solid black;
?? ??? ??? ?}
?? ??? ?</style>
?? ?</head>
?? ?<body>
?? ??? ?<canvas id="canvas"></canvas>
?? ??? ?<script src="digit.js"></script>
?? ??? ?<script>
?? ??? ??? ?let WINDOW_WIDTH=1024;
?? ??? ??? ?let WINDOW_HEIGHT= 768;
?? ??? ??? ?let RADIUS = 8;
?? ??? ??? ?let MARGIN_TOP = 60;
?? ??? ??? ?let MARGIN_LEFT = 30;
?? ??? ??? ?
?? ??? ?window.onload = function(){//確定整個(gè)頁面加載完成 執(zhí)行
?? ??? ??? ?let c2d = document.querySelector("canvas").getContext("2d");
?? ??? ??? ?canvas.width = WINDOW_WIDTH;
?? ??? ??? ?canvas.height = WINDOW_HEIGHT;
?? ??? ??? ?
?? ??? ??? ?render(c2d)? //調(diào)用函數(shù)
?? ??? ?}
?? ??? ?
?? ??? ?function render( c2d ){? //自定義函數(shù)
?? ??? ??? ?let h = 12;//小時(shí)
?? ??? ??? ?let m = 34;//分鐘
?? ??? ??? ?let s = 56;//秒
?? ??? ??? ?
?? ??? ??? ?//renderDight(x, y, num, c2d);//調(diào)用函數(shù)
?? ??? ??? ?renderDigit( MARGIN_LEFT , MARGIN_TOP , parseInt(h/10) ,c2d);
?? ??? ??? ?renderDigit( MARGIN_LEFT + 15*(RADIUS+1) , MARGIN_TOP , parseInt(h%10) , c2d );
?? ??? ??? ?renderDigit( MARGIN_LEFT + 30*(RADIUS+1) , MARGIN_TOP , 10 , c2d );
?? ??? ??? ?renderDigit( MARGIN_LEFT + 39*(RADIUS+1) , MARGIN_TOP , parseInt(m/10) ,c2d);
?? ??? ??? ?renderDigit( MARGIN_LEFT + 54*(RADIUS+1) , MARGIN_TOP , parseInt(m%10) ,c2d);
?? ??? ??? ?renderDigit( MARGIN_LEFT + 69*(RADIUS+1) , MARGIN_TOP , 10 , c2d);
?? ??? ??? ?renderDigit( MARGIN_LEFT + 78*(RADIUS+1) , MARGIN_TOP , parseInt(s/10) , c2d);
?? ??? ??? ?renderDigit( MARGIN_LEFT + 93*(RADIUS+1) , MARGIN_TOP , parseInt(s%10) , c2d);
?? ??? ?}
?? ??? ?
?? ??? ?function renderDight(x, y, num, c2d){ //自定義函數(shù)-繪制時(shí)鐘
?? ??? ??? ?c2d.fillStyle = "red";
?? ??? ??? ?
?? ??? ??? ?for(let i=0; i<digit[num].length; i++){
?? ??? ??? ??? ?for(let j=0; j<digit[num][i].length; j++){
?? ??? ??? ??? ??? ?if(digit[num][i][j]==1){
?? ??? ??? ??? ??? ??? ?c2d.beginPath();
?? ??? ??? ??? ??? ??? ?let _x = j*2*(RADIUS+1)+(RADIUS+1);
?? ??? ??? ??? ??? ??? ?let _y = i*2*(RADIUS+1)+(RADIUS+1);
?? ??? ??? ??? ??? ??? ?c2d.arc(_x, _y, RADIUS, 0, 2*Math.PI);
?? ??? ??? ??? ??? ??? ?c2d.closePath();
?? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ?c2d.fill();
?? ??? ??? ??? ??? ?}//end if
?? ??? ??? ??? ?}// end for
?? ??? ??? ?}//end for
?? ??? ?}
?? ??? ?</script>
?? ?</body>
</html>

正在回答

1 回答

http://img1.sycdn.imooc.com//5ef71de70001801f06720324.jpg

函數(shù)名寫錯了。

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

為什么renderDigit 無定義? 求大神解答

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號