Opacity fading 
Author Message
 Opacity fading

Hi!

The JavaScript function below fades in the opacity of an image from 0 - 100.
The problem is that it fades too slow. The setTimeout delay is set to 0.
Can anyone help me to speed up this function? VBScript would be just as fine
since this can't be done in NS anyway. I want the image to fade in as
smoothly as possible so changing "i++" to "i=i+2" won't do.

function fadeImage(oImage)
{
 if (document.all)
 {
  oFadeImage = document.images[oImage];
  _doFade(oFadeImage, 0)
 }

Quote:
}

function _doFade(oFadeImage, i)
{
 oFadeImage.filters.alpha.opacity = i;
 i++;
 if (i < 100) setTimeout("_doFade(oFadeImage, " + i + ")", 0);

Quote:
}

/Thanks, Billy.


Mon, 01 Sep 2003 23:55:54 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Help TP!

2. Opacity fading

3. Fade Out Opacity Effect

4. Real Fade-in and Fade-out

5. Fade-in and Fade-out of button controls

6. Fade in and Fade out images???

7. Fade-in, Fade-out images???

8. Fade-in, Fade-out effect

9. Help with Transparency (Opacity) in Windows Forms.

10. Round Form with 50% opacity?

11. Form flashing momentarily before opacity makes it visible

12. Control opacity

 

 
Powered by phpBB® Forum Software