ho fatto un conto alla rovescia con una tela di disegnojquery canvas cerchio
codice di lavoro: http://jsfiddle.net/ajFsx/
window.onload = function() {
canvas = document.getElementById('timer'),
seconds = document.getElementById('counter'),
ctx = canvas.getContext('2d'),
sec = 180,
countdown = sec;
ctx.lineWidth = 8;
ctx.strokeStyle = "#528f20";
var
startAngle = 0,
time = 0,
intv = setInterval(function(){
var endAngle = (Math.PI * time * 2/sec);
ctx.arc(65, 35, 30, startAngle , endAngle, false);
startAngle = endAngle;
ctx.stroke();
countdown--;
if (countdown > 60){
seconds.innerHTML = Math.floor(countdown/60);
seconds.innerHTML += ":" + countdown%60;
}
else{
seconds.innerHTML = countdown;
}
if (++time > sec,countdown == 0) { clearInterval(intv), $("#timer, #counter").remove(), $("#timers").prepend('<img id="theImg" src="#" />'); }
}, 10);
}
La mia domanda è la seguente come posso ottenere questo disegno più bello, in modo che nessun pixel?
Ho cercato spesso su tela jquery ma non riesco a trovare dove sto cercando.
che era molto bene. –