0

Water filling cup effect - optimization

Hey guys! https://code.sololearn.com/W069rCwI9TnL/#html Im new here, and im just start programming and playing with html/css/js. My questions are how to improve clearity of my code and how to control my graphics on the site for optimization?

22nd Nov 2018, 9:31 AM
Damian Wardach
Damian Wardach - avatar
1 Réponse
+ 1
Nifty. 🙂 I noticed your comment on the JS tab. The reason why it doesn't work is because the script in the JS tab runs at the beginning of loading the HTML and you need yours to run after. To defer this, you can either wrap the entire script in a window.onload or place window.onload at the end of the JS tab and call the relevant functions through it. (I think the latter makes for clearer code, but others are free to disagree. 🙂)
22nd Nov 2018, 10:03 AM
Janning⭐
Janning⭐ - avatar