Hello, yes, there is a way to exchange each background for the day of the week:
Scripting code:
<script type="text/javascript"><!--
var imlocation = "Images/";
function ImageArray (n) {
this.length = n;
for (var i =1; i <= n; i++) {
this[i] = ' '
}
}
image = new ImageArray(7);
image[0] = 'sunday.PNG';
image[1] = 'monday.PNG';
image[2] = 'tuesday.PNG';
image[3] = 'wednesday.PNG';
image[4] = 'thursday.PNG';
image[5] = 'friday.PNG';
image[6] = 'saturday.PNG';
var currentdate = new Date();
var imagenumber = currentdate.getDay();
document.write('<img src="' + imlocation + image[imagenumber] + '">');
</script>
Creates a folder called Images
and add the images with each name of the week, you can change the names to Portuguese.
The most efficient way to do it is on the server side, so if you want to use Javascript, I suggest studying Node.js. Doing this with Javascript on the client side is pure masochism.
– Oralista de Sistemas
Have you seen the website Composer? He does this, only he randomly generates the image (0.5, if I’m not mistaken) and exchanges the images.
– UzumakiArtanis