Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // # of images
- var imgCount = 30;
- // image directory
- var dir = '';
- // random the images
- var randomCount = Math.round(Math.random() * (imgCount - 1)) + 1;
- // array of images & file name
- var images = new Array
- images[1] = "_BGIMG01.jpg",
- images[2] = "_BGIMG02.jpg",
- images[3] = "_BGIMG03.jpg",
- images[4] = "_BGIMG04.jpg",
- images[5] = "_BGIMG05.jpg",
- images[6] = "_BGIMG06.jpg",
- images[7] = "_BGIMG07.jpg",
- images[8] = "_BGIMG08.jpg",
- images[9] = "_BGIMG09.png",
- images[10] = "_BGIMG10.jpg",
- images[11] = "_BGIMG11.jpg",
- images[12] = "_BGIMG12.jpg",
- images[13] = "_BGIMG13.jpg",
- images[14] = "_BGIMG14.jpg",
- images[15] = "_BGIMG15.jpg",
- images[16] = "_BGIMG16.jpg",
- images[17] = "_BGIMG17.jpg",
- images[18] = "_BGIMG18.jpg",
- images[19] = "_BGIMG19.jpg",
- images[20] = "_BGIMG20.jpg",
- images[21] = "_BGIMG21.jpg",
- images[22] = "_BGIMG22.jpg",
- images[23] = "_BGIMG23.jpg",
- images[24] = "_BGIMG24.jpg",
- images[25] = "_BGIMG25.jpg",
- images[26] = "_BGIMG26.jpg",
- images[27] = "_BGIMG27.jpg",
- images[28] = "_BGIMG28.jpg",
- images[29] = "_BGIMG29.jpg",
- images[30] = "_BGIMG30.jpg",
- document.body.style.backgroundImage = "url(" + dir + images[randomCount] + ")";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement