码迷,mamicode.com
首页 > 其他好文 > 详细

文字逐个出现效果

时间:2017-04-17 11:49:25      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:rip   bst   index   一个个   val   display   demo   head   charset   

文字一个个出现的demo

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<pre id="showWord"></pre>
<div style="display:none" id="word">
   xxxxxxxxxxxxxxxxxxxxx
</div>
<script language="javascript">
    var index=0;
    var word=document.getElementById("word").innerHTML;
    function type(){
        document.getElementById("showWord").innerText = word.substring(0,index++);
    }
    setInterval(type, 200);
</script>
</body>
</html>

 

文字逐个出现效果

标签:rip   bst   index   一个个   val   display   demo   head   charset   

原文地址:http://www.cnblogs.com/intangible/p/6721916.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!