...

View Full Version : Remove Crossfade from Slideshow?



bettywebgirl
06-17-2004, 07:52 AM
Hi,
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:
http://www.codelifter.com/main/javascript/slideshow4.html

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?
Thanks!

glenngv
06-17-2004, 08: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.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();
}
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.

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

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

Change to following line

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

to

document.images.PictureBox.style.filter="blendTrans()";

comment out the following line

document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";

//document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";

change the following line

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

to

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