SHARE
TWEET

Untitled

a guest Feb 16th, 2020 217 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.             // # of images
  3.             var imgCount = 30;
  4.             // image directory
  5.             var dir = '';
  6.             // random the images
  7.             var randomCount = Math.round(Math.random() * (imgCount - 1)) + 1;
  8.             // array of images & file name
  9.             var images = new Array
  10.                     images[1] = "_BGIMG01.jpg",
  11.         images[2] = "_BGIMG02.jpg",
  12.         images[3] = "_BGIMG03.jpg",
  13.         images[4] = "_BGIMG04.jpg",
  14.         images[5] = "_BGIMG05.jpg",
  15.         images[6] = "_BGIMG06.jpg",
  16.         images[7] = "_BGIMG07.jpg",
  17.         images[8] = "_BGIMG08.jpg",
  18.         images[9] = "_BGIMG09.png",
  19.         images[10] = "_BGIMG10.jpg",
  20.         images[11] = "_BGIMG11.jpg",
  21.         images[12] = "_BGIMG12.jpg",
  22.         images[13] = "_BGIMG13.jpg",
  23.         images[14] = "_BGIMG14.jpg",
  24.         images[15] = "_BGIMG15.jpg",
  25.         images[16] = "_BGIMG16.jpg",
  26.         images[17] = "_BGIMG17.jpg",
  27.         images[18] = "_BGIMG18.jpg",
  28.         images[19] = "_BGIMG19.jpg",
  29.         images[20] = "_BGIMG20.jpg",
  30.         images[21] = "_BGIMG21.jpg",
  31.         images[22] = "_BGIMG22.jpg",
  32.         images[23] = "_BGIMG23.jpg",
  33.         images[24] = "_BGIMG24.jpg",
  34.         images[25] = "_BGIMG25.jpg",
  35.         images[26] = "_BGIMG26.jpg",
  36.         images[27] = "_BGIMG27.jpg",
  37.         images[28] = "_BGIMG28.jpg",
  38.         images[29] = "_BGIMG29.jpg",
  39.         images[30] = "_BGIMG30.jpg",
  40.  
  41.              
  42.             document.body.style.backgroundImage = "url(" + dir + images[randomCount] + ")";
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top