JavaScript text gradually fades in and out. A more professional saying is "fade in and out". It was initially used in the production of video montage and Flash Animation. Now it is not uncommon to use text. the Fade-in and fade-out of this Code is quite smooth. It also comes from the combination of JavaScript and CSS.
<Title> JavaScript text is gradually displayed </title> <script language = "JavaScript"> <! -- Begin ie4 = (navigator. appVersion. indexOf ("MSIE")> 0) & (parseInt (navigator. appVersion)> = 4); var count = 0, count2 = 0, add1 = 3, add2 = 10, timerID; function show () {if (ie4) {count + = add1; count2 + = add2; delay = 30; if (count2> 100) count2 = 100; if (count> 100) {count = 100; add1 =-10; add2 =-3; delay= 350;} if (count <0) count = 0; if (count2 <0) {count2 = 0; add1 = 3; add2 = 1 0; delay= 200;} fader. style. filter = "Alpha (Opacity =" + count2 + ", FinishOpacity =" + count + ", style = 2)"; timerID = setTimeout ("show ()", delay) ;}} window. onload = show; // End --> script <p id = "fader" style = "width: 730; Filter: Alpha (Opacity = 0, FinishOpacity = 0, style = 2) "> do you know? Jb51.NET </p>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]