Answer the question
In order to leave comments, you need to log in
How to change the background?
It is not exactly monotonous colors that are needed, but for the picture of the entire wrapper to change
Answer the question
In order to leave comments, you need to log in
Something like this:
var imgs = [
"url_1.jpg",
"url_2.jpg",
"url_3.jpg",
"url_4.jpg",
"url_5.jpg"
];
var counter = 0;
var length = imgs.length;
var $wrapper = $("#wrapper");
setInterval(function () {
counter++;
if (counter > length - 1) {
counter = 0;
}
$wrapper.css("backgroundImage", "url(" + imgs[counter] + ")");
}, 10000);
If you need a nominal smooth change in the background color, then a long time ago I wrote a simple script jsfiddle.net/straj/9g2wrx81
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question