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 20:36:59 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Opacity fading

2. Fade Out Opacity Effect

3. Real Fade-in and Fade-out

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

5. Fade in and Fade out images???

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

7. Fade-in, Fade-out effect

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

9. Round Form with 50% opacity?

10. Form flashing momentarily before opacity makes it visible

11. Control opacity

12. A bug in opacity processing and MDI forms

 

 
Powered by phpBB® Forum Software