您好,欢迎访问一九零五行业门户网

一个不错的渐隐文字效果

<!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=gb2312"> <title>无标题文档</title> <script language="javascript"> var col=255; var se=1 function chg() { document.getelementbyid("title").style.color="rgb(" + col + "," + col + "," + col + ")"; if (col == 0){se = 1;} else if(col == 255){se = -1;} col += se; settimeout('chg()', 10); } </script> </style> </head> <body onload="chg()"> <form name="titlechk"> <tr> <td width="210" colspan="6" background="img/jb_bg_t2.jpg"> <div id="inputbox" style="margin-left: 11px; margin-bottom: 2px;"> <input id="title" type="text" name="stitle" class="tmptxt" value="guitarmusic" style="font-size: 12px; width: 180px; height: 16px; border: none;" readonly align="absmiddle"> </div> </td> </tr> <input name="text1" type="button" onclick="chg()"> </form> </body> </html>
<script language="javascript"> var col=000; var se=3 var txt = new array() txt[0] = "0" txt[1] = "1" txt[2] = "2" txt[3] = "3" var all=1; function chg() { document.getelementbyid("title1").style.color="rgb(" + col + "," + col + "," + col + ")"; if (col < 255 ){ se = 15; col += se; var aaa=settimeout('chg()', 1); } else {window.cleartimeout(aaa);chgtext();} } function chg2() { document.getelementbyid("title1").style.color="rgb(" + col + "," + col + "," + col + ")"; if (col > 0 ){ se = 15; col -= se; var aaa=settimeout('chg2()', 1); } else {window.cleartimeout(aaa);} } function chgtext() { if(all==txt.length){document.getelementbyid("title1").value=txt[0];all=0;all+=1;} else{document.getelementbyid("title1").value=txt[all];all=all+1;}; chg2(); } </script> <form name="titlechk"> <tr> <td width="210" colspan="6" background="img/jb_bg_t2.jpg"> <div id="inputbox" style="margin-left: 11px; margin-bottom: 2px;"> <input id="title1" type="text" name="stitle" class="tmptxt" value="0" style="font-size: 12px; width: 180px; height: 16px; border: none;" readonly align="absmiddle"> </div> </td> </tr> <input name="text1" type="button" onclick="chg()"> </form>
其它类似信息

推荐信息