Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Random image script


gty

Recommended Posts

Posted

I use

 

<tr>

 

<td><a href="http://www.***.com/catalog/*****.html?infoBox=6"><img src="/catalog/images/image.gif" alt="image" border="0"></a></td>

 

</tr>

 

on my left column at the bottom for product promotions and what not and was wondering if anybody knows of a script that I can use to set a random images where only 1 will be displayed at a time with linking to the specifc category or product?

 

Thanks!

Posted

Thanks but I found another script after I googled it...the only issue is it puts the images at the very top of the left column.I would like to have the images on the bottom as they previously were. I have tried adding the align=bottom but then the pics do not even shop up?

here's the code below.

<script language="JavaScript"><!--

 

images = new Array(4);

 

images[0] = "<a href = 'http://www.***.com/catalog/***-c-28.html?infoBox=4'><img src='myimages/image1.gif' alt=image test></a>";

 

images[1] = "<a href = 'http://www.***.com/catalog/***-c-150.html?infoBox=4'><img src='myimages/image2.gif' alt='image test'></a>";

 

images[2] = "<a href = 'http://www.***com/catalog/***-c-172.html?infoBox=6'><img src='myimages/image3.gif' alt='image test'></a>";

 

images[3] = "<a href = 'http://www.***.com/catalog/***-c-23.html?infoBox=1'><img src='myimages/image4.gif' alt='image test'></a>";

 

index = Math.floor(Math.random() * images.length);

 

document.write(images[index]);

 

//done

 

// --></script><br>

I have tried adding the align= bottom and absolute bottom right after the image source but they still do not show up after adding that. I am now stuck as how to get the images to show up directlty at the bottom of the column.

Any suggestion??

Thanks!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...