Help with an image rotation script....

by Jagged
1 replies
  • WEB DESIGN
  • |
I have a simple, open-source image rotation script that I am using on a clients site. It is written for single use on a single page. Presently it is used on the main page only.
My client is requesting on his "services page" that each service has a separate rotating set of images....all on the same page.

Is there a simple way or edit to this script so it will run in multiple locations on the same page?

I am posting the script below....I got it from simplythebest.net. It is free, open-source software: you can redistribute it and/or modify it under the terms of the GNU General Public License.

If you need to see the clients site and see how the script is used and see the service page so you can get a feel of what he wants done......send me a PM.

If it is something that is a bit more complicated and I need to outsource to rentacoder of freelance.....let me know that too....thanks

------------------------------

** this javascript is placed in the <header>**


<!--
// Courtesy of SimplytheBest.net - SimplytheBest Scripts
gSlideshowInterval = 5;
gNumberOfImages = 4;
gImages = new Array(gNumberOfImages);
gImages[0] = "http://www.myclientswebsite/rotate_images/photo1.jpg";
gImages[1] = "http://www.myclientswebsite/rotate_images/photo2.jpg";
gImages[2] = "http://www.myclientswebsite/rotate_images/photo3.jpg";
gImages[3] = "http://www.myclientswebsite/rotate_images/photo4.jpg";

function canManipulateImages() {
if (document.images)
return true;
else
return false;
}
function loadSlide(imageURL) {
if (gImageCapableBrowser) {
document.slide.src = imageURL;
return false;
}
else {
return true;
}
}
function nextSlide() {
gCurrentImage = (gCurrentImage + 1) % gNumberOfImages;
loadSlide(gImages[gCurrentImage]);
}
gImageCapableBrowser = canManipulateImages();
gCurrentImage = 0;
setInterval("nextSlide()",gSlideshowInterval * 1000);


---------------------------

**this is placed at the location on the web page you want it to show**

<img src="rotate_images/image1.jpg" name="slide" width="215" height="175" border="0">


**I created a folder "rotate_images" and upload the images I want to use to this file...

---------------------------
#image #rotation #script
  • Profile picture of the author Jagged
    Do you think it will work if I use the same javascript in the ehader (unchanged) and where I place the image source at the location....use this at the first location:
    <img src="rotate_images/image1.jpg" name="slide" width="215" height="175" border="0">

    use this at the second location:
    <img src="rotate_images_2/image1-2.jpg" name="slide" width="215" height="175" border="0">
    ......and create a new file "rotate_images_2"

    use this at the third location:
    <img src="rotate_images_3/image1-3.jpg" name="slide" width="215" height="175" border="0">
    ......and create a new file "rotate_images_3"

    and so on at each location? Will something as simple as that work?
    {{ DiscussionBoard.errors[6295101].message }}

Trending Topics