jquery队列函数用法实例
本文实例讲述了jquery队列函数用法。分享给大家供大家参考。具体实现方法如下:
<!DOCTYPE>
<html>
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/>
<scripttype="text/javascript"src="jquery-1.9.1.js"></script>
</head>
<body>
<style>
div{margin:3px;width:40px;height:40px;
position:absolute;left:0px;top:30px;
background:green;display:none;}
div.newcolor{background:blue;}
</style>
Clickhere...
<div></div>
<script>
$(document.body).click(function(){
$("div").show("slow");
//$("div").slideDown();
$("div").animate({left:'+=200'},2000);
$("div").queue(function(){//入队列
$(this).addClass("newcolor");
$(this).dequeue();//出队列
});
$("div").animate({left:'-=200'},2000);
$("div").queue(function(){//入队列
$(this).removeClass("newcolor");
$(this).dequeue();//出队列
});
$("div").slideUp();
});
</script>
</body>
</html>
希望本文所述对大家jQuery程序设计的学习有所帮助。
热门推荐
10 小红书平安祝福语简短
11 生日祝福语大全女孩简短
12 收生日红包祝福语 简短
13 领证幽默祝福语简短
14 法考面试祝福语简短
15 老哥出门祝福语简短语
16 送灯祝福语简短独特
17 幼儿狗年祝福语大全简短
18 好听的元旦简短祝福语