Home › Forums › Design › Load random CSS on page load › Reply To: Load random CSS on page load
November 10, 2016 at 2:43 am
#247705
Participant
Hey,
thanks. That will help a lot.
Only thing i have to figure out is how to use the PHP’s mt_rand() function. We will see.
By now i managed to be successful with this javascript. I created a empty div in html and multiple div.random- css designs.
But i am not sure if it works with a additional logo implemented in css.
…
<script type=”text/javascript”>
document.getElementsByTagName(‘body’)[0].className+=’ random-‘ + Math.floor((Math.random() * 3) + 1);
</script>
…