<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<body>

一:
<textarea id="showStr"></textarea>
<div style="display:none" id="string">请在此输入您想咨询的问题
</div>
<script language="javascript">
var index=0;
var str=document.getElementById("string").innerHTML;
function type(){
if(index==str.length){index=0;}
    document.getElementById("showStr").innerText = str.substring(0,index++);
}
setInterval(type, 500);
</script>

二:

<p id="aa" class="string"></p>
<p style="display:none" id="w">请在此输入您想咨询的问题</p>

<script type="text/javascript">
window.onload = type;
var index = 0;
var word = $("#w").html();

function type(){
$("#aa").html(word.substring(0,index++));
if(index > word.length) {
return;
} else {
setTimeout(type,430);
};
}

</script>

</body>
</html>

原文链接:https://blog.csdn.net/liu__hua/article/details/38869615

最新文章

  1. linux-rpm
  2. [ios]纯代码实现UITableViewCell的自定义扩展
  3. oracle学习 一 (持续更新中)
  4. .net MVC 下载文件乱码问题解决方案
  5. 微软职位内部推荐-Data Scientist
  6. C++智能指针(auto_ptr)详解
  7. 动态分配内存补充 realloc
  8. The Swift Programming Language--语言指南--协议
  9. 微信小程序之提高应用速度小技巧
  10. Spring的JDBC(非web程序)的简单例子
  11. 使用supervisor管理进程
  12. ubunto启动chrome报错
  13. 【UVA】11400 照明系统设计 排序+dp
  14. 生产环境Linux常用命令【随时更新】
  15. C#缓存absoluteExpiration、slidingExpiration两个参数的疑惑
  16. PL/SQL Developer显示中文乱码
  17. SRM470
  18. pgm8
  19. tar 使用总结
  20. [CoreOS 转载] CoreOS实践指南(三):系统服务管家Systemd

热门文章

  1. Mongodb添加副本及修改优先级
  2. 理解Spring定时任务的fixedRate和fixedDelay
  3. Lucene系列-facet--转
  4. SQL中的go、begin、end的用法
  5. angularjs 依赖注入原理与实现
  6. src或者href值为base64编码代码
  7. MVC 之HTML辅助方法
  8. [javaSE] 变量的传值与传址
  9. SpringMVC中文件上传
  10. MyBatis入门(二)—— 输入映射和输出映射、动态sql、关联查询