Home  >  Article  >  Web Front-end  >  Create neon text code and special effects based on JavaScript_javascript skills

Create neon text code and special effects based on JavaScript_javascript skills

WBOY
WBOYOriginal
2016-05-16 15:41:151515browse

Example 1:

The screenshot of the running effect is as follows:

The specific code is as follows:

http-equiv="Content-Type" content="text/html; charset=gb2312">

Neon Light

var Tname="欢迎您的到来!";
var Tlen=Tname.length;
document.write(""+Tname+"");
var col=new Array("#FFCC00","#3333FF","#FFCC00","#FF0000","#FFCC00","#CC33FF");
var ic=0;
function Dcolor(){
 var Strname="";
 for (i=0;iTlen;++i){
 var Strname=Strname+"+col[ic]+">"+Tname.substring(i,i+1)+"";
 ic=ic+1;
 if (ic==col.length) ic=0;
 }
 a.innerHTML=Strname;
 setTimeout("Dcolor()",200);
}
Dcolor();
 class="style5">

Example 2:

The rendering is as follows:

Demo effect Source code download

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn