I
I
Ilya Korablev2015-01-07 23:04:06
JavaScript
Ilya Korablev, 2015-01-07 23:04:06

How to update website background?

Hello everybody!
There are several (3) images in the background folder.
How can I make the background change when the page is refreshed?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
IceJOKER, 2015-01-08
@IceJOKER

var path = '/bg/';
var rand = Math.round(Math.random() * 3);
$('body').css('backgroundImage', path + rand + ".jpg");

something like this

R
Roger, 2015-01-07
@mrquake

Greetings!
Look here
searchengines.guru/showthread.php?t=817209

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question