PDA

View Full Version : Help with Fade in Image Slideshow



drew1jg
04-02-2005, 08:15 PM
Script: Fade-in Slideshow
URL: http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

Could anyone show me how to make this slideshow not loop. I would like it to stop after going through the photos only once and ending at the same photo where it started. Thanks.

drew1jg
04-02-2005, 08:44 PM
can someone please help? I have to put this up on my website in memory of John Paul II

jscheuer1
04-02-2005, 08:52 PM
Sure, find these two lines in the code:
tempobj.innerHTML='<img src="'+fadeimages[nextimageindex]+'">'
nextimageindex=(nextimageindex<fadeimages.length-1)? nextimageindex+1 : 0Make them look like this:
tempobj.innerHTML='<img src="'+fadeimages[nextimageindex]+'">'
if ((nextimageindex==1)&&(a==1))
return;
if (nextimageindex==0)
a=1;
nextimageindex=(nextimageindex<fadeimages.length-1)? nextimageindex+1 : 0and at the top add to this:
var slideshow_width='140px' //SET IMAGE WIDTH
var slideshow_height='225px' //SET IMAGE HEIGHT
var pause=3000 //SET PAUSE BETWEEN SLIDE (3000=3 seconds)like this:
var slideshow_width='140px' //SET IMAGE WIDTH
var slideshow_height='225px' //SET IMAGE HEIGHT
var pause=3000 //SET PAUSE BETWEEN SLIDE (3000=3 seconds)
var a

swandiva
04-26-2005, 05:35 PM
I, too, am attempting to stop the cross fade after it has transitioned from image "0" to image "1". (In my case, a photo of a light fixture fading from off to on.)
I followed the posted directions, and now the first image ("0")loads, but there is just an image placeholder where the second ("1") should be. This is an awesome script, but I cannot use it unless my rabbit brain can somehow figure out the snag in my script.
Forgive me, but I do not have an active link this page I'm working on; I've simply created a test page that has it's images in same directory.
Please advise!
Thank you,
Eleanor
Here is what I've done:

var slideshow_width='288x' //SET IMAGE WIDTH
var slideshow_height='191px' //SET IMAGE HEIGHT
var pause=3000 //SET PAUSE BETWEEN SLIDE (3000=3 seconds)
var a
var fadeimages=new Array()
//SET 1) IMAGE PATHS, 2) optional link, 3), optional link target:
fadeimages[0]=["ceilpendconeoff.jpg", "", ""] //plain image syntax
fadeimages[1]=["ceilpendconeon.jpg", "", ""] //image with link syntax

AND THEN...

tempobj.innerHTML='<img src="'+fadeimages[nextimageindex]+'">'
if ((nextimageindex==1)&&(a==1))
return;
if (nextimageindex==0)
a=1;
nextimageindex=(nextimageindex<fadeimages.length-1)? nextimageindex+1 : 0

swandiva
04-26-2005, 05:52 PM
After actually looking at the code, I simply changed the last digit in the code to "1" rather than "0", to represent the "on" light fixture.
Thank you, if anyone read my post, and I hope this helps someone else in the future.
-eleanor