javascript queue 打字效果
2024-10-19 12:33:03
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>jquery queue</title>
<script src="framework/jquery-1.10.2.min.js"></script>
<script>
var content = "javascript is a good language!!";
$(function(){
function callback(){
console.log(this);
} function notify(word){
console.log("notify:" + word);
$("#content").append(word);
} var arr = content.split(' '); $.each(arr,function(index,item){
for(var i=0; i<item.length; i++) {
// console.log(i + " !!i = " + (!!i) + (!i));
(function(word){
$("#content").queue("dynamicStyle", function(next){
callback.call($(this));
notify(word);
next();
}).delay(200,"dynamicStyle");
})(item[i]);
}
$("#content").queue("dynamicStyle", function(next){
callback.call($(this));
notify(" ");
next();
}).delay(200,"dynamicStyle"); }); $("#content").dequeue("dynamicStyle");
});
</script>
</head>
<body>
<div id="content"></div>
</body>
</html>
最新文章
- 【Win10开发】Toast通知
- spring事务学习(转账案例)(一)
- Python Opearte MS-SQL Use Pymssql
- strlen() 和 strcpy()函数
- HDU 1405 The Last Practice
- javascript获取元素的计算样式
- 经验:Ubuntu 登陆 L2TP VPN
- Tomcat剖析(三):连接器(1)
- Modbus软件开发实战指南 之 开发自己的Modbus Poll工具 - 1
- 安卓笔记-- popupwindow back键不消失的问题
- IIS版本号可以被识别 解决方案
- 51Node 1051---最大子矩阵和
- Python GIL(Global Interpreter Lock)
- Python生成文件列表
- quantum theory
- Python20-Day05
- Git-远程仓库【转】
- tomcat下manager配置
- docker的私有仓库的搭建
- phpcms 添加稿件到栏目 add_content
热门文章
- python多线程(二)
- Laravel 出现";RuntimeException inEncrypter.php line 43: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.";问题的解决办法
- ActiveMQ 核心概念
- 数据性能调校——查看最耗资源的各种SQL
- python 报错——Python TypeError: &#39;module&#39; object is not callable 原因分析
- NodeJS应用程序设置为window service-辅助工具(C#)
- des加密——补齐
- Oracle数据库的启动与关闭
- 基于linux的ekho(余音)安装与开发
- 【转载】OpenWrt sysupgrade 命令行更新固件到最新版