+ 7
How to add background?
how to add background that changes after every minute
13 Réponses
+ 14
@Prashanth Kumar, you need to restart you app.
/*This generally happens while running an infinite loop*/
+ 12
You can get help from here. You will just need to change the time interval.
https://code.sololearn.com/WFS5ylDMpdCc/?ref=app
+ 12
Thanks @Prashanth Kumar
+ 8
https://code.sololearn.com/W5AbLeDWPQN1/?ref=app
very simple code
+ 8
there's something wrong in sololearn or in my phone none of the code with colors is working
is yours working ????🐒🐒
+ 8
ok i will restart app
+ 8
oh nice now its working thank you Biraj Patel
+ 8
@Biraj Patel congrats for guru badge
+ 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
+ 6
yessss
+ 4
setInterval(changeBg, 2000)
function changeBg() {
var bg = $(".bg");
var colorRandom = Math.floor(Math.random()*16777215).toString(16);
bg.css({background: colorRandom});
}
+ 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