html页面文字打字机效果--js实现
<html> <head> <title>Charlie是我们E1的头!</title> </head> <body> <br><br> <div id='div1'></div> <script type="text/javascript"> var count=0; var typingtext="Charlie是我们E1的头!<br><br>顶Charlie<br>要顶Charlie<br>必须顶Charlie<br>不得不顶Charlie<br>用尽全力顶Charlie<br>再加上千斤顶Charlie<br>总之把它顶到顶Charlie<br>接着使出葵花宝顶Charlie<br>就算顶到史前也要顶Charlie<br>老子看了会用道德经顶Charlie<br>孔子亲自拜你为师天天顶Charlie<br>秦始皇站在阿房宫上使劲顶Charlie<br>汉高祖挥师杀向东罗马为你顶Charlie<br>吕布抛弃了貂蝉而选择了为你顶Charlie<br>张三丰见了用太极拳九全式全力顶Charlie<br>左冷禅召开武林盟主大会商讨如何顶Charlie<br>西门吹雪从此学会了最强一招剑神一顶Charlie<br>龙剑飞的如来神掌最后一式改为万佛朝顶Charlie<br>陆小凤从此现也不管闲事了而专门来为你顶Charlie<br>四大名捕四面出击看天下还有没有人敢不再项Charlie<br>唐僧师徒不去西天取经专程回来召集纵僧为你顶Charlie<br>瑞星杀毒软件从此不杀木马了节约资源只为帮你顶Charlie"; var myBlock=document.getElementById('div1'); function type(){ if(count<=typingtext.length){ myBlock.innerHTML=typingtext.substring(0,count); count++; }else{ window.clearInterval(intervalID); } } var intervalID=window.setInterval(type,50); </script> </body> </html>