How JS achieves the neon text effect _ javascript skills

Source: Internet
Author: User
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.