我知道错误在哪里,但我该如何改变它?时钟的位置在deg?JS中的旋转元素 - 我应该如何更改我的JS代码?
<script>
var secondHand = document.querySelector('.second-hand');
function setDate() {
var now = new Date();
var seconds = now.getSeconds();
var min = now.getMinutes();
var hour = now.getHours();
var secondsDegrees = ((seconds/60) * 360) + 90;
secondHand.style.transform = "rotate(secondsDegrees)deg)"; console.log(seconds);
};
setInterval(setDate, 1000);
</script>
</body>
</html>
创建一个小提琴请 – Amogh
代码共享是好的吗? – PaulK
https://codeshare.io/5zlmEN – PaulK