/    Sign up×
Community /Pin to ProfileBookmark

problem adding images to fade slideshow

Hello,

I used coding from this link([url]http://javascript.internet.com/[/url] miscellaneous /fading-slide-show.html) for a fading slideshow on my website ([url]www.ottawarenovationgroup.com[/url]). My problem is where it says to add images just continue the array below. If I try to add one image to that array it will not play the slideshow when you visit my site. I can change the images out of the 5 it allows but can not add more. Any help would be appreciated. Thanks

Don

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@DracoMerestAug 29.2011 — I see it working on your site but there is no indication of how you may have failed. Since I

cannot see the error you caused I cannot help but only suggest you make sure the image

is accessible from the same place the other images are. If the image is in a different folder

then you need to include the entire path to the image.
Copy linkTweet thisAlerts:
@FairviewAug 29.2011 — donnyboy32:

Are you still looking for a solution to your problem?
Copy linkTweet thisAlerts:
@donnyboy32authorAug 30.2011 — Hi Fairview,

Sorry to take so long to get back to you. Yes I am still looking for help with the code. The image is definetly accesible because once I realized it would not work by adding a sixth image, I took out an old one that was working and put in the new image and it worked. It only doesn't work when I try to add a sixth image to the array. The slideshow actually doesn't do anything at all. Just stays on the initial upload image. This is the code for my site:

<html>

<head>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

// Set slideShowSpeed (milliseconds)

var slideShowSpeed = 5000;

// Duration of crossfade (seconds)

var crossFadeDuration = 20;

// Specify the image files

var Pic = new Array();

// to add more images, just continue

// the pattern, adding to the array below

Pic[0] = 'slidebath.jpg'

Pic[1] = 'bathroomtub.jpg'

Pic[2] = 'showerstall.jpg'

Pic[3] = 'porch.jpg'

Pic[4] = 'deck.jpg'


// do not edit anything below this line

var t;

var j = 0;

var p = Pic.length;

var preLoad = new Array();

for (i = 0; i < p; i++) {

preLoad[i] = new Image();

preLoad[i].src = Pic[i];

}

function runSlideShow() {

if (document.all) {

document.images.SlideShow.style.filter="blendTrans(duration=2)";

document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";

document.images.SlideShow.filters.blendTrans.Apply();

}

document.images.SlideShow.src = preLoad[j].src;

if (document.all) {

document.images.SlideShow.filters.blendTrans.Play();

}

j = j + 1;

if (j > (p - 1)) j = 0;

t = setTimeout('runSlideShow()', slideShowSpeed);

}

// End -->

</script>



<title>Ottawa Renovation Group</title>

<link rel="shortcut icon" href="favicon.ico" >



</head>



<BODY onLoad="runSlideShow()">



<img src="slidebath.jpg" width=100% name='SlideShow'>





Of course there is some code in between the body and the image but it is irrelevant to the slideshow. Thank you for your response and any future ones.



Don



FYI when i try to add a new image i put:



Pic[5] = 'image.jpg'



I put this right underneath the pic[4]
Copy linkTweet thisAlerts:
@DracoMerestAug 30.2011 — Everything tests ok for me locally. The script is very simple.

I see it working with 5 images on your server. Can you show us a live faulty one?
Copy linkTweet thisAlerts:
@FairviewAug 30.2011 — donnyboy32:

I did give up on you. Besides, it's difficult to get a word in here.

Try this Fading Slideshow Demo

[LIST]
  • [*]No coding needed

  • [*]Create the HTML for your images, the code does the rest

  • [*]Images may be different sizes

  • [*]Pause onmouseover

  • [*]Optional Caption overlay onmouseover

  • [*]Any image may also be a link

  • [/LIST]


    You may edit these three variables, to suit:

    [CODE]var rotateDelay = 3.5; // 3.5 seconds;
    var randomize = false; // or true;
    var useCaptions = true; // or false;[/CODE]


    Just copy the code for yourself, using view source.
    Copy linkTweet thisAlerts:
    @donnyboy32authorAug 31.2011 — Hi everyone,

    I must have been doing something really stupid because I tried again to just add to the array and it worked. Sry for wasting your time but thank you as your response saying you saw nothing wrong made me try again. Thanks

    Don
    ×

    Success!

    Help @donnyboy32 spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.22,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...