Log in

View Full Version : Change parameters in Ultimate Fade-in slideshow



mitja
01-22-2009, 04:14 PM
1) Script Title: Ultimate Fade-in slideshow (v1.51)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...nslideshow.htm

3) Describe problem: I would like to change some parameters of the script.

the speed of the fade effect. It's seem too speedy for me and I would like to slow down it.
Somewhere I read (if I remember well) that the fade is made of 10 frames from the actual to the new immage. How to change this, to made the fade more smooth?

mitja
01-22-2009, 04:43 PM
ok, seems that I'm not so stupid what I think :-)

The speed or the steps / frames between two images is controlled by this parameter in the head of the document:

...
function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
...

I changed the last parameter (10) to something lower.
I put the last line to

...
obj.degree+=3
...

My only (other) question is:
The visibility starts at 10% and then reach in steps decided with the upmentioned parameter to 100% (more or less)
the difference is 90% (100% - 10%)
The number (in my case 3) must be divisible with 90 or can be any number from 1 to 90 (or even 100)?

jscheuer1
01-22-2009, 05:00 PM
In my experience, it must divide evenly into 10, so 3 wouldn't be the best choice (I recommend 2, 5, 10 - anything higher is too fast - 1 is too slow), but most browsers will average out the results, and the script resets each new image to 10 again before fading it in.

There is another place where you can adjust the rate of fading in:


fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)

The number 50 there. The higher that number, the slower things will go. 70 is pretty slow, any higher than that and the effect will be choppy. 20 is the lowest number you can safely use.

I generally advise folks to adjust both the number you identified and this other one to get the optimal speed and smoothness for the rate of fading they want.

One thing to be careful of though, if the rate of fading takes longer than the delay between images, things can get to a point where no image ever gets the chance to fade all of the way in.

mitja
01-22-2009, 05:06 PM
Thanks for your advice.