Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在以下网站上使用时钟示例。
时钟中的一切都在工作,除了时针。时针始终保持在 12 点。
我已经按原样使用了整个代码。什么都没有改变。时钟在示例页面上工作正常。
有人可以帮我解决这个问题吗?
泽山
如果您使用的是 24h 格式的机器,请在 setTime 方法中添加“%12”:
hourNeedle.value = h%12;
希望这可以帮助,