• 当前标签:canvas_clock

凑个数,canvas绘制时钟

许久不更新了一样,用以前学习作业凑个数,canvas绘制的时钟,效果图: js代码 var canvas = document.getElementById('canvas'); var can = canvas.getContext('2d'); clock(); setInterval(clock,1000); function clock(){ can.clearRect(0,0,canvas.width,canvas.height); // 获取时间 var nowTime = new Date(); var H = nowTime.getHours(); var M = nowTim

2016-11-16 22:05:56 2805 5 37
阅读详情
  • 1
前往