Dynamically Change the Image in On load

Dynamically Change the Image in On load

<script type="text/javascript">
var images = [], 
index = 0;
images[0] = "<a href = 'http://www.pfeifferstudio-com.mybigcommerce.com/'><img src='http://cdn6.bigcommerce.com/s-vqetyz9/template/images/Pfeifer-Studio-Logo_beige_1.gif' border='0' id='LogoImage' alt='pfeiferstudio.com'></a>";
images[1] = "<a href = 'http://www.pfeifferstudio-com.mybigcommerce.com/'><img src='http://cdn6.bigcommerce.com/s-vqetyz9/template/images/Pfeifer-Studio-Logo_blue.gif' border='0' id='LogoImage' alt='pfeiferstudio.com'></a>";
images[2] = "<a href = 'http://www.pfeifferstudio-com.mybigcommerce.com/'><img src='http://cdn6.bigcommerce.com/s-vqetyz9/template/images/Pfeifer-Studio-Logo_orange.gif' border='0' id='LogoImage' alt='pfeiferstudio.com'></a>";
images[3] = "<a href = 'http://www.pfeifferstudio-com.mybigcommerce.com/'><img src='http://cdn6.bigcommerce.com/s-vqetyz9/template/images/Pfeifer-Studio-Logo_red.gif' border='0' id='LogoImage' alt='pfeiferstudio.com'></a>";
images[4] = "<a href = 'http://www.pfeifferstudio-com.mybigcommerce.com/'><img src='http://cdn6.bigcommerce.com/s-vqetyz9/template/images/Pfeifer-Studio-Logo_yellow.gif' border='0' id='LogoImage' alt='pfeiferstudio.com'></a>";
index = Math.floor(Math.random() * images.length);
document.write(images[index]);
</script>

Leave a Reply

Your email address will not be published. Required fields are marked *