Hi I am bit of a script kiddy can use java and fiddle my way around but not to far.... i am busy coding our new company site and am using the following function to display random images in the banner section of the site. i run the code 4 times to get it the site to display 4 images at the top in the "banners section" like this
<div id="banner_right">
<script type="text/javascript" language="JavaScript"><!--
printImage();//--></script>
<script type="text/javascript" language="JavaScript"><!--
printImage();//--></script>
<script type="text/javascript" language="JavaScript"><!--
printImage();//--></script>
<script type="text/javascript" language="JavaScript"><!--
printImage();//--></script>
</div>
I am battling to upgrade the script so i can run it once to display 4 side by side images and each one must be unique ..... i just not coming right here as it is beyond my current level. the java code i am using is
NumberOfImagesToRotate = 26;
FirstPart = '<a href="/products/products.html"><img src="/banners/img';
LastPart = '.jpg" height="200" width="200"></a>';
function printImage() {
var r = Math.ceil(Math.random() * NumberOfImagesToRotate);
document.write(FirstPart + r + LastPart);
}
any pointers or help would be awesome !