Guest User

Untitled

a guest
Jan 7th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.81 KB | None | 0 0
  1. <script type="text/javascript">
  2.                 var imgCount = 10;
  3.                     var dir = 'images/';
  4.                     var randomCount = Math.round(Math.random() * (imgCount - 1)) + 1;
  5.                     var images = new Array
  6.                         images[1] = "bg1.jpg",
  7.                         images[2] = "bg2.jpg",
  8.                         images[3] = "bg3.jpg",
  9.                         images[4] = "bg4.jpg",
  10.                         images[5] = "bg5.jpg",
  11.                         images[6] = "bg6jpg",
  12.                         images[7] = "bg7.jpg",
  13.                         images[8] = "bg8.jpg",
  14.                         images[9] = "bg9.jpg",
  15.                         images[10] = "bg10.jpg",
  16.                     document.getElementByTagName("body").style.backgroundImage = "url(" + dir + images[randomCount] + ")";
  17.     </script>
Advertisement
Add Comment
Please, Sign In to add comment