View Full Version : Remove Crossfade from Slideshow?

06-17-2004, 06:52 AM
I am not a JavaScript expert by any means, but I can sometimes adapt a script for my own use. I am attempting to use a script from Codelifter.com, it's a JavaScript slideshow at:

I would post just the relevant sections, but I am not skilled enough to single those out effectively. The problem I am having is that the crossfade timing is *supposed* to be adjustable, and I have tried changing the duration:

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 1;

but no number I put in appears to change the duration, I was hoping a duration of 0 would eliminate the effect, but no luck there.

Can anyone point me in the right direction?

06-17-2004, 07:19 AM
Changing from 2 to 1 is not quite noticeable but it makes the fade a little faster. If you want to eliminate the effect if set to 0, you have to modify the control() function.

function control(how){
if (showHot){
if (how=="H") jss = 1;
if (how=="F") jss = jss + 1;
if (how=="B") jss = jss - 1;
if (jss > (pss)) jss=1;
if (jss < 1) jss = pss;
if (document.all && CrossFadeDuration>0){
document.images.PictureBox.src = preLoad[jss].src;
if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
if (document.all && CrossFadeDuration>0) document.images.PictureBox.filters.blendTrans.Play();
return false;
<a class="Controls" href="#" onClick="return control('B');">< <</a>

I also added the return false bit so that the link action is cancelled and # will not show in the address bar.

06-17-2004, 02:18 PM
Thank you so much, that works perfectly!

Mr J
06-17-2004, 05:39 PM
In order to change the blend duration please try the following

Change to following line




comment out the following line



change the following line

if (document.all) document.images.PictureBox.filters.blendTrans.Play();


if (document.all) document.images.PictureBox.filters.blendTrans.Play(CrossFadeDuration);

then change the variable CrossFadeDuration to whatever you want

var CrossFadeDuration = 5;

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum