How to add background? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

How to add background?

how to add background that changes after every minute

12th May 2017, 8:24 AM
Hafiz Hamza
Hafiz Hamza - avatar
13 Answers
+ 14
@Prashanth Kumar, you need to restart you app. /*This generally happens while running an infinite loop*/
14th May 2017, 5:35 PM
Biraj Patel
+ 12
You can get help from here. You will just need to change the time interval. https://code.sololearn.com/WFS5ylDMpdCc/?ref=app
12th May 2017, 8:30 AM
Biraj Patel
+ 12
Thanks @Prashanth Kumar
14th May 2017, 5:39 PM
Biraj Patel
12th May 2017, 4:10 PM
Prashanth Kumar
Prashanth Kumar - avatar
+ 8
there's something wrong in sololearn or in my phone none of the code with colors is working is yours working ????🐒🐒
14th May 2017, 5:33 PM
Prashanth Kumar
Prashanth Kumar - avatar
+ 8
ok i will restart app
14th May 2017, 5:35 PM
Prashanth Kumar
Prashanth Kumar - avatar
+ 8
oh nice now its working thank you Biraj Patel
14th May 2017, 5:37 PM
Prashanth Kumar
Prashanth Kumar - avatar
+ 8
@Biraj Patel congrats for guru badge
14th May 2017, 5:39 PM
Prashanth Kumar
Prashanth Kumar - avatar
+ 7
Don't made a background which can change color. Make a code which can change image after some seconds. I made a program which can change background
14th May 2017, 5:25 PM
Suyash Purwar
Suyash Purwar - avatar
+ 6
yessss
14th May 2017, 5:34 PM
Suyash Purwar
Suyash Purwar - avatar
+ 4
setInterval(changeBg, 2000) function changeBg() { var bg = $(".bg"); var colorRandom = Math.floor(Math.random()*16777215).toString(16); bg.css({background: colorRandom}); }
12th May 2017, 10:49 AM
tehzarathustra
12th May 2017, 11:20 AM
Calviղ
Calviղ - avatar
+ 2
Why do you guys rush into using jQuery? just make it element then do an interval for the .backgroundImage to change every set amount of time
23rd May 2017, 12:30 AM
Eric
Eric - avatar