0
Can anyone solve this problem the clock is not rotating...
2 Réponses
0
The directly related problem is that you assign 'window' object but you need to assign its 'onload' event handler:
window.onload = () => {}
... or shorter, only 'onload' because window is the global object (as ypu do for 'setInterval' wich is a window method) and is always scope accessible, until you've declared variable with name conflict ('onload' here) in the actual scope (or parent scope)...
Second, you'll be better advised to specify a delay to your setInterval call... if not, the callback is run approximativelly every 3ms.: in your case, update the clock a few more than one time every 1 sec. should be enough to avoid delay artefacts (300ms sounds good to me).
The real secondary problem is how you build your html clock structure: if you run your code now that js problem is fixed, click needles are rotating, but not as you expect... So, a code is shorter than a descriptions of changes to make in your css to fix this:
https://code.sololearn.com/W31hjrXEaGuN/?ref=app
0
Tq so much bro...