[SOLVED]Help me to load my resources in my web project | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

[SOLVED]Help me to load my resources in my web project

I created a clock app (attached with the question). It contains a dark mode/light mode switcher button. When the user clicks the button the background of the page changes to light/dark image accordingly. The default BG image is light . THE PROBLEM IS THAT WHEN USER CLICKS THE DARK MODE BUTTON, IT TAKES 2 TO 3 SECS TO LOAD THE DARK IMAGE BECAUSE THE IMAGE STARTS LOADING WHEN USER CLICKS THE BUTTON. CAN YOU HELP ME TO LOAD THE IMAGE INTO THE DOCUMENT AS SOON AS THE DOCUMENT LOADS AND IT CAN THIS USE THE IMAGE WHEN THE USER CLICKS THE BUTTON Here's the code: https://code.sololearn.com/WkAJZ4P71hEp/?ref=app

20th Aug 2020, 9:26 AM
Satyam Mishra
Satyam Mishra - avatar
2 Answers
+ 4
Satyam Mishra I understand ur question, but i think that its impossible, it would take some time fetch that image coz u r providing a url. So if u download the image on pc and use it, it won't take that long, but u can't do it on sololearn.
20th Aug 2020, 11:19 AM
maf
maf - avatar
+ 3
Thanks Mr. Rimon, But, I did not understand how will lesson help
20th Aug 2020, 10:00 AM
Satyam Mishra
Satyam Mishra - avatar