dimanche 12 juin 2016

Javascript random background top right fixed

I got the code working, basically. I am having trouble getting the image set to be top right on the site layout. It's defaulting to bottom right and that's not what I desire.

Any help on getting it so the image displays at the top right since I'm at a loss.

I bet it's something simple too. >.o

<script type='text/javascript'>
var bgColorArray = ['http://ift.tt/21h348F','http://ift.tt/25ScaiS','http://ift.tt/21h32NZ','http://ift.tt/25SbVo2','http://ift.tt/21h3Fr0','http://ift.tt/25Scj5X','http://ift.tt/21h2IyN','http://ift.tt/25Sc7Uj','http://ift.tt/21h3lbF','http://ift.tt/25SbOJb','http://ift.tt/21h3oEy','http://ift.tt/25Sc7nl'],
    selectBG = bgColorArray[Math.floor(Math.random() * bgColorArray.length)];

document.body.style.backgroundImage = 'url(' + selectBG + ')';
</script>




Aucun commentaire:

Enregistrer un commentaire