delay(duration,[queuename])
设置一个延时来推迟执行队列中之后的项目。
jQuery 1.4新增。用于将队列中的函数延时执行。他既可以推迟动画队列的执行,也可以用于自定义队列。
duration:延时时间,单位:毫秒
queueName:队列名词,默认是Fx,动画队列。
参数描述speed可选。规定延迟的速度。可能的值:毫秒"slow""fast"queueName可选。规定队列的名称。默认是 "fx",标准效果队列。
完整测试代码:
例:
头部与底部延迟加载动画效果
$("button").click(function(){
$("#div1").delay("slow").fadeIn();
$("#div2").delay("fast").fadeIn();
});
This example sets different speed values for the delay() method.
基于jQuery的AJAX和JSON的实例 中文WORD版
本文档主要讲述的是基于jQuery的AJAX和JSON的实例;过jQuery内置的AJAX功能,直接访问后台获得JSON格式的数据,然后通过jQuer把数据绑定到事先设计好的html模板上,直接在页面上显示。有需要的朋友可以下载看看
下载
$(document).ready(function() {
$('#header')
.css({ 'top':-50 })
.delay(1000)
.animate({'top': 0}, 800);
$('#footer')
.css({ 'bottom':-15 })
.delay(1000)
.animate({'bottom': 0}, 800);
});
