Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Trying to display random pictures on my page


Guest

Recommended Posts

ok so i found this java script and have been working with it but cant get it to work. Where it says FirstPart = '<img src=pic"'; is the name of the picture taht i am using or the directory name? if its the pic name how do i make it look in a certain directory? thanks again,

Jesse

ok so i found this script for displaying random pictures. i created a a directory for th images and i labled the pic1.jpg, pic2.jpg and so fourth. where it says FirstPart = '<img src=pic"'; is that the name of the directory or the pictures? I have meesed around with this and followed direction exactly. i found this script here

 

http://www.web-source.net/web_development/random_images.htm

 

any help would be greatly appreciated, thanks again

Jesse

 

<script type="text/javascript" language="JavaScript">

<!-- Copyright 2002 Bontrager Connection, LLC

//

// Type the number of images you are rotating.

 

NumberOfImagesToRotate = 5;

 

// Specify the first and last part of the image tag.

 

FirstPart = '<img src=pic"';

LastPart = '.jpg" height="117" width="166">';

 

function printImage() {

var r = Math.ceil(Math.random() * NumberOfImagesToRotate);

document.write(FirstPart + r + LastPart);

}

//-->

</script>

Link to comment
Share on other sites

What kind of random images are you trying to get. There is a few contrib for random images.

 

If its random new products I use this one http://www.oscommerce.com/community/contri.../download,11860

 

If you are tryin to get a courasel type thing there is one called "spinner" here

http://www.oscommerce.com/community/contri.../download,10063

Link to comment
Share on other sites

I would use the random new products it also has the buy now button feature to display on the front page as well.

 

If you chose this just click on the link about as it is to the same one that I use.

 

Hope this helps

Link to comment
Share on other sites

http://www.oscommerce.com/community/contributions,651

That link is for featured products which is great if you want to pick specific products to show randomly on page loads.

 

This is a good random product one

http://www.oscommerce.com/community/contributions,715

along with http://www.oscommerce.com/community/contributions,3410 which Eric linked for download.

 

If you are trying to display content from osCommerce outside of osCommerce, like on a welcome page then http://www.oscommerce.com/community/contributions,1444 is a good contribution to use.

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

If you are trying to display content from osCommerce outside of osCommerce, like on a welcome page then http://www.oscommerce.com/community/contributions,1444 is a good contribution to use.

 

thanks wendy this contribution has got me really interested, however im really bad with coding ect...but my qustion is when it asks in the directions

INSTALLATION:

 

1. Just copy and paste the code to the top of the page you want to use the content in.

2. There must be no html or php output above the application_top.php include

(unless you use buffering, etc.), or you will get "headers already sent" errors.

3. Just echo your buffered content wherever you want it later in the page (wrap it in correctly sized tables, link the OSC stylesheet, etc.).

 

"1. Just copy and paste the code to the top of the page you want to use the content in."

Im assuming that this would be my index page correct? and if it is do i put this above where the html starts?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...