var now = moment(),
second = now.seconds() * 6,
minute = now.minutes() * 6 + second / 60,
hour = ((now.hours() % 12) / 12) * 360 + 90 + minute / 12;
$('#hour').css("transform", "rotate(" + hour + "deg)");
$('#minute').css("transform", "rotate(" + minute + "deg)");
$('#second').css("transform", "rotate(" + second + "deg)");
hour = ((now.hours() % 12) / 12) * 360 + 90 + minute / 12;
这个hour的角度,为什么要加上90度
这是和#hour
这个元素的初始位置相关的,和数学没有关系哦
CSS中的2D旋转夹角的定边是9点和时钟中心点的连线,而时针转角的定边是12点和中心点的连线。