Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help with new box in right column?


bwd

Recommended Posts

I am trying to create a new box and run the script below in it. I can get the script to run, but it just shows the image/link, that is generated. I would like the image to be inside a box(Border and header...) like the rest of the boxes. If anyone can help it will be greatly appreciated. Here is the script I want to run in the box.

 

<!-- random_article //-->

<tr>

<script Language="JavaScript">

<!--

// original script by Geoff McCausland http://www.jetlink.net/~webpro

function makeArray(){

this.length = makeArray.arguments.length

for (var i = 0; i < this.length; i++)

this[i + 1] = makeArray.arguments

}

var now = new Date();

var sec = now.getSeconds();

// NUM IS THE NUMBER OF BANNERS TO CHOOSE FROM

var num = 2;

// LIST THE URL TO LINK TO AND THE IMAGE TAG BELOW EACH ENTRY MUST BE FOLLOWED BY A COMMA EXCEPT THE LAST ENTRY WHICH NEEDS THE CLOSING PARENTHESIS AND A SEMI-COLON

var bannerArray = new makeArray(

'<td align="center" ><A href="http://www.mysite.com" target="_blank"><img src="images/myphoto.gif" alt="My Photo On My Site" border=0 hspace=0 vspace=0></td>',

'<td align="center" ><A href="http://www.mysite.com" target="_blank"><img src="images/myphoto2.gif" alt="My Photo On My Site" border=0 hspace=0 vspace=0></td>'

);

 

for (i = 1; i <= num; i++) {

if (sec <= (i * 60 / num) && sec > ((i - 1) * 60 / num)) {

document.write (bannerArray);

}

}

// -->

</script>

 

</tr>

<!-- random_article_eof //-->

 

This script randomly picks one of the two or more, images to be displayed.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...