Js+css Imitation Typing effect

Source: Internet
Author: User

1. Effects

2. Source code

<%@ Page ContentType="Text/html;charset=utf-8"language="Java" %><HTML><Head>    <styletype= "Text/css">#myDiv{Display:Inline-block;width:500px;Height:300px;Background-color:Rgba (0,0,0,0.3);Color:Hsla (0,100%,70%,1);Word-wrap:Break-word;Line-height:30px;letter-spacing:3px;Padding-left:3px;text-indent:40px;Border-radius:5px;-webkit-box-shadow:3px 3px 3px 3px rgba (0,0,0,0.1);-moz-box-shadow:3px 3px 3px 3px rgba (0,0,0,0.1);Box-shadow:3px 3px 3px 3px rgba (0,0,0,0.1);        }    </style>    <Scripttype= "Text/javascript">window.onload= function () {            varmydiv=document.getElementById ("mydiv"); varContentarr= "Autumn comes the sky is like a piece of sapphire that covers the Earth. The small pond outside the village opened with clear eyes, staring at the beautiful sky. A pair of small white geese with their heads to admire their reflection in the water shadow. The leaves of the maple tree in the Valley do not know whether to drink an excessive amount of wine, red like a group of fire. Village before the rice, low head bent waist, in the autumn wind silently waiting for people to reap, in midair, lined with "people" shaped geese flock, happy singing songs, Farewell to People, to the horizon slowly fly to ...". Split (""); varcontent= ""; varIndex= 0; varID=SetInterval (function() {content+=Contentarr[index]; mydiv.innerHTML=content+ "_"; Index++; if(Index===contentarr.length) {mydiv.innerhtml=content;                    Clearinterval (ID); Console.log ("it's over."); }            }, -); }    </Script></Head><Body><DivID= "Mydiv"></Div></Body></HTML>

Js+css Imitation Typing effect

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.