您的位置:首页 > Web前端 > JavaScript

js打字机效果_js打字效果

2013-08-11 20:31 411 查看
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="珞珈网络科技有限公司-js打字机效果_js打字效果">
<meta name="Keywords" content="js打字机效果,js打字效果">
<meta name="Description" content="">
<style type="text/css">
#demo{font-family:宋体; font-size:14px; line-height:22px; background:#f5f5f5; color:#000;}
</style>
</head>

<body>
<p id="demo"></p>
<script>
var myVar="珞珈网络团队位于秀美的武汉大学珞珈山脚下,以武汉大学优秀的人才资源为依托为客户提供一流的建站服务和完善的售后保障...欢迎致电027-87860378与客服沟通洽谈,或访问我们的官网http://www.luojianet.com/了解更多关于公司信息。";
x=myVar.length;
myArray=myVar.split("");
i=0;
var int=this.setInterval("shuchu()",100);
function shuchu()
{
document.getElementById('demo').innerHTML+=myArray[i++];
if (i==x)
{
int=window.clearInterval(int);
}
}

</script>
</body>
</html>


演示链接:http://www.luojianet.com/news/html/Noname1.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: