Random Content

To randomise content on one of your single design pages, do this in HTML mode:

Put this in your page header, it starts by hiding all the DIVs from your content area.

<style>#home1,#home2,#home3,#home4,#home5,#home6,#home7  {  display: none;}</style>

 

Put this in your page content, this way you can edit all the sections easily... but only 1 actually displays when viewing the site.

<DIV ID=home1>first optional content</DIV>

<DIV ID=home2>second optional content</DIV>

 

Put this in your page footer or EndCode.html. The EndCode is found under "Custom Design Templates" > "EndCode.html". Change the 6 to however many DIVs you have. This script just selects one DIV to display at random, thus achieving what you want.

<script type="text/javascript">

var numDivs = 6;

document.getElementById('home'+(Math.floor(Math.random()*numDivs)+1)).style.display = 'inline';

</script>   

Index Previous Next