3
Contributors
2
Replies
27
Views
3 Years
Discussion Span
Last Post by profmuluka
0

There are variety of ways to accomplish this, but a simple solution may include assinging a random background image to the page every time the page is loaded.

This would involve storing the path of the images in a javascript array and generating a random number within the length of the array. This random number will be used for selecting the array index that holds the picture for the background image.

Here's a demo: http://itg.somee.com/dw/dw-466413/

The script may look something like this...

<script>
  var backImg = [
      "image1.jpg",
      "image2.jpg",
      "image3.jpg"
  ];

var rnd = Math.floor(Math.random() * backImg.length);   

if (document.body){
   document.body.style.backgroundImage = 'url(' + backImg[rnd] + ')';
}
</script>

Why dont you give it a try, post some of your own code and see if you can build upon the sample above..

Edited by JorgeM

0

try aimated gif or use refresh component and serve different version of the page. but best is to use javascript or php

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.