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