打字效果代码

来源:互联网 发布:大数据应用在哪些领域 编辑:程序博客网 时间:2024/04/29 18:07
<script language="JavaScript" type="text/javascript">
document.writeln("<SCRIPT>");
document.writeln("var message=\"有人问我,假如你只有三天光明,你会如何利用这三天?我轻轻的闭上眼睛,眼前立刻变得黑漆漆的一片,我在黑暗中摸索着,东西在倒下,发出乒乓的响声,却不知道是什么东西发出的响声。此时我领悟到光的重要性。多么希望它能给我指路啊! 我迅速睁开眼睛,光很快的袭来,我好象鱼儿得到了水那样轻松,立刻去查看什么东西倒了。由衷的感叹:光真的很重要!\"");
document.writeln("var n=0;");
document.writeln("if (document.all){");
document.writeln("document.write(\'<font size=\"30px\" color=\"#EFEFEF\">\')");
document.writeln("for (m=0;m<message.length;m++)");
document.writeln("document.write(\'<span id=\"neonlight\" style=\"font-size:30px\">\'+message.charAt(m)+\'<\/span>\')");
document.writeln("document.write(\'<\/font>\')");
document.writeln("var tempref=document.all.neonlight");
document.writeln("}");
document.writeln("else");
document.writeln("document.write(message)");
document.writeln("function neon(){");
document.writeln("if (n==0){");
document.writeln("for (m=0;m<message.length;m++)");
document.writeln("tempref[m].style.color=\"#ffffff\"");
document.writeln("}");
document.writeln("tempref[n].style.color=\"#d50000\"");
document.writeln("if (n<tempref.length-1)");
document.writeln("n++");
document.writeln("else{");
document.writeln("n=0");
document.writeln("clearInterval(flashing)");
document.writeln("setTimeout(\"beginneon()\",1000)");
document.writeln("return");
document.writeln("}");
document.writeln("}");
document.writeln("function beginneon(){");
document.writeln("if (document.all)");
document.writeln("flashing=setInterval(\"neon()\",200)");
document.writeln("}");
document.writeln("beginneon()");
document.writeln("<\/SCRIPT>");
</script>
原创粉丝点击