I have an array (below)
var img_name = new Array("images/test.jpg", "images/test.jpg");
var imgTotal = img_name.length;
var rnd_no = Math.floor(imgTotal*Math.random());
var ojimg = img_name[rnd_no];
I need to do another piece of information and attach it to the body tag. So. if test1.jpg is loaded, I need to transfer βlightβ to the body of the body, and if another image is selected, I need to transfer βdarkβ. This means that the user in CMS chooses a light or dark theme depending on the image. The image will be displayed randomly.
user141621
source
share