This article mainly introduces how JS achieves the neon text effect. It involves the dynamic operation skills of javascript traversing strings and page styles. The effect is brilliant and has some reference value, for more information, see the example in this article. Share it with you for your reference. The details are as follows:
Here, JS is used to implement the special effect code of the neon text on the webpage. If you look at the running effect, you will see that the color of the text is like a neon light, continuously changing, colorful, and dazzling, so it's called the neon text, or the color-changing effect of the text.
The running effect is as follows:
The Code is as follows:
Neon lightsScript var Tname = "Welcome! "; 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; I
I hope this article will help you design javascript programs.