I'm trying to do a clock with css rotate and jquery. The rotate part is done, but now i have to do a spin in the clock and stop at the time of computer's user.
The part i can't do is the spin and stop at the right time. My code, now, is:
function horario(){
var now = new Date();
var hour = now.getHours();
var minutes = now.getMinutes();
var hourDegraus = hour * 30;
var minuteDegraus = minutes * 6;
$(".pont-hour").css({ WebkitTransform: 'rotate(' + hourDegraus + 'deg)'});
$(".pont-hour").css({ '-moz-transform': 'rotate(' + hourDegraus + 'deg)'});
$(".pont-hour").css({ 'transform': 'rotate(' + hourDegraus + 'deg)'});
$(".pont-minutes").css({ WebkitTransform: 'rotate(' + minuteDegraus + 'deg)'});
$(".pont-minutes").css({ '-moz-transform': 'rotate(' + minuteDegraus + 'deg)'});
$(".pont-minutes").css({ 'transform': 'rotate(' + minuteDegraus + 'deg)'});
}
Basically, i want to do a spin and in the end the pointers stop at the time in variables hourDegraus and minuteDegraus.
Any idea how i can do the spin?