jQuery的链式动画写法中加入setTimeout
来源:互联网 发布:mac第三方压缩软件 编辑:程序博客网 时间:2024/05/29 19:16
今日闲逛,看到一个简单的封装,用于在两次animate之间,加入一定的时间间隔的等待。
原文地址:http://docs.jquery.com/Cookbook/wait
你还可以在里边看到demo
- $.fn.wait = function(time, type) {
- time = time || 1000;
- type = type || "fx";
- return this.queue(type, function() {
- var self = this;
- setTimeout(function() {
- $(self).dequeue();
- }, time);
- });
- };
具体用法是,.wait( [time], [type] )
第一个参数是时间,默认是1000毫秒。
第二个参数是类型,默认是fx即动画效果
- function runIt() {
- $("div").wait()
- .animate({left:'+=200'},2000)
- .wait()
- .animate({left:'-=200'},1500,runIt);
- }
- runIt();
- jQuery的链式动画写法中加入setTimeout
- jquery的链式写法
- jQuery事件的链式写法
- jQuery中setTimeout的几种使用方法
- jQuery中setTimeout的几种使用方法
- jQuery中setTimeout的几种使用方法
- jQuery中setTimeout的几种使用方法
- jQuery中setTimeout的几种使用方法
- jquery中使用setTimeout()
- for循环中加入延时函数setTimeout
- jQuary事件的链式写法
- JQ选择的链式写法
- java/android的链式写法
- jquery中settimeout与setInterval使用时的注意事项
- jQuery中使用setTimeout()与setInterval()方法的区别
- Jquery中使用setInterval和setTimeout的方法
- jQuery中setTimeout的几种使用方法小结
- setTimeOut传参数的时候的写法
- Qt 之 QVector
- Hibernate配置文件和映射元素解释
- Java中的字符编码(Unicode、UTF-8、UTF-16)的那些事儿
- 测试将死
- Qualcomm 处理器 Krait架构
- jQuery的链式动画写法中加入setTimeout
- WORD技巧
- 《高性能网站建设指南》阅读笔记_规则12- 移除重复脚本
- IBM IaaS:云计算基础架构明星产品解决方案
- shell获取当前系统时间
- BI 2013发展趋势分析
- 邮件营销整体解决方案
- 张裕vs长城 烟台
- HTML ISO-8859-1 参考手册(实体字符)