Rollback999

How Would You Replicate the Google Fading Effect on Their Home Page?

Asked by Rollback999 2 years ago google fading effect


Csgs
0
 
There are actually two ways to accomplish this. You can use Pure CSS or some JavaScript. For the benefit of probability I'd say Google utilizes JS for this effect which can later be confirmed using a tool such as FireBug.

All you have to do is gradually change the CSS opacity attribute of the element using JS:

Function fadeIn() {
    var element = document.getElementById("someID");
    var newOpacity = element.style.opacity + 0.07;
    element.style.opacity = newOpacity;
    if (newOpacity < 1) {
        window.setTimeout(fadeIn, 60);
    }
}

by Csgs 2 years ago

Answer this question

How Would You Replicate the Google Fading Effect on Their Home Page?

0 errors found:

 
0