Flashing text on web pages
Author:Eve Cole
Update Time:2009-06-20 17:01:03
Many friends are surprised to see flashing text on some web pages when surfing the Internet. In fact, this is not difficult. Just use JavaScript to segment the program. Friends who do not know JavaScript language do not need to worry. Just put the following source code into your web page and the text will flash on your web page.
The source files are as follows:
"html"
"head"
《meta http-equiv=″Content-Type″ content=″text/html; charset=gb2312″》
"title" flashing text "/title"
《meta name=″GENERATOR″ content=″Microsoft FrontPage 3.0″》
《/head》
《body bgcolor=″#000000″ text=″#000000″》
"p" "/p"
"h1 align="center"" flashing text "/h1"
《/body》
"script language="JavaScript""
//color is the RGB value of the text color, increasing it from "0F" to "FF"
var color=new Array(″0F″,″1F″,″2F″,″3F″,
"4F", "5F", "6F", "7F", "8F", "9F", "AF", "BF",
"CF","DF","EF","FF");
//i is the coordinate of the array color, add determines the increase or decrease of color
var i=0,add=1;
FadeText();
functionFadeText()
{
//document.fgColor determines the RGB value of the text color document.fgColor=″#″+color[i]+color[i]+color[i];
//Determine whether the text color is getting brighter or darker if(add==1)
{
i++;
if( i==15 ) add=0;
}
else
{i--;
if( i==0 ) add=1;
}
//Set to run the function FadeText() every 0.1 seconds
setTimeout(″FadeText()″,100);
}
《/script》
《/html》
(Xu Dewei, Guangdong)