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

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

為什么定時(shí)器不起作用?

var?window_width=1024;
var?window_height=768;

var?radius=8;
var?margin_left=30
var?margin_top=60;

const?endTime?=?new?Date(2016,8,21,23,22,52);
var?curShowTimeSeconds?=?0;
function?getTimeSeconds(){
	var?now=new?Date();
	var?ret=parseInt(endTime.getTime()-now.getTime());
	ret?=?Math.round(?ret/1000?);
	return?ret;
}


function?render(cxt){
	cxt.clearRect(0,0,window_width,window_height);

	var?hours?=?parseInt(?curShowTimeSeconds?/?3600);
	var?minutes=parseInt((curShowTimeSeconds?-?hours?*?3600)/60);
	var?seconds=curShowTimeSeconds?%?60;

	renderDigit(margin_left,margin_top,parseInt(hours/10),cxt);
	renderDigit(margin_left+15*(radius+1),margin_top,parseInt(hours%10),cxt);
	renderDigit(margin_left+30*(radius+1),margin_top,10,cxt);
	renderDigit(margin_left+39*(radius+1),margin_top,parseInt(minutes/10),cxt);
	renderDigit(margin_left+54*(radius+1),margin_top,parseInt(minutes%10),cxt);
	renderDigit(margin_left+69*(radius+1),margin_top,10,cxt);
	renderDigit(margin_left+78*(radius+1),margin_top,parseInt(seconds/10),cxt);
	renderDigit(margin_left+93*(radius+1),margin_top,parseInt(seconds%10),cxt);
	
}
function?renderDigit(x,y,num,cxt){
	cxt.fillStyle="rgb(0,102,233)";

	?for(?var?i?=?0?;?i?<?digit[num].length?;?i?++?){
????????for(var?j?=?0?;?j?<?digit[num][i].length?;?j?++?){
			if(digit[num][i][j]==1){
				cxt.beginPath();
				cxt.arc(x+2*j*(radius)+(radius+1),y+2*i*(radius+1)+(radius+1),radius,0,2*Math.PI);
				cxt.closePath();
				cxt.fill();
			}
		}
	}
}
function?update(){
	var?nextTimeShow=getTimeSeconds();

	var?nextHours=parseInt(?nextTimeShow?/?3600);
	var?nextMinutes=parseInt((nextTimeShow?-?nextHours?*?3600)/60);
	var?nextSeconds=nextTimeShow?%?60;

	var?curHours=parseInt(?curShowTimeSeconds?/?3600);
	var?curMinutes=parseInt((curShowTimeSeconds?-?curHours?*?3600)/60);
	var?curSeconds=curShowTimeSeconds?%?60;

	if(nextSeconds?!=?curSeconds){
		curSeconds=nextSeconds;
	}
}	
window.onload=function(){
	var?canvas=document.getElementById('canvas');
	var?context?=?canvas.getContext("2d");

	canvas.width=window_width;
	canvas.height=window_height;
	curShowTimeSeconds?=?getTimeSeconds();
	setInterval(function(){
		render(context)
		update()
	},50);
	
}


正在回答

1 回答

http://img1.sycdn.imooc.com//57e2a662000169ef06440054.jpg圓心x的值不對(duì)

x+2*j*(radius+1)+(radius+1).先改改這個(gè)

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

Richardson 提問者

不是這個(gè)問題,我找到問題了 是curSeconds=nextSeconds賦值賦錯(cuò)了
2016-09-25 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

為什么定時(shí)器不起作用?

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

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

幫助反饋 APP下載

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

公眾號(hào)

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