jquery队列函数用法实例
作者:bea
本文实例讲述了jquery队列函数用法。分享给大家供大家参考。具体实现方法如下: 代码如下: <!DOCTYPE> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="jquery-1.9.1.js"></scri
本文实例讲述了jquery队列函数用法。分享给大家供大家参考。具体实现方法如下:
代码如下:
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="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>
Click here...
<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程序设计的学习有所帮助。
有用 | 无用
代码如下:
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="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>
Click here...
<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程序设计的学习有所帮助。
有用 | 无用
猜你喜欢
您可能感兴趣的文章:
- node.js中的fs.openSync方法使用说明
- node.js中的fs.open方法使用说明
- node.js中的fs.closeSync方法使用说明
- node.js中的fs.close方法使用说明
- node.js中的fs.readdirSync方法使用说明
- node.js中的fs.readdir方法使用说明
- node.js中的fs.readlinkSync方法使用说明
- node.js中的fs.readlink方法使用说明
- node.js中的fs.readSync方法使用说明
- Javascript Object 对象学习笔记
- node.js中的fs.read方法使用说明
- node.js中的fs.mkdirSync方法使用说明
- node.js中的fs.mkdir方法使用说明
- 使用FlexiGrid实现Extjs表格效果方法分享
- jQuery+css实现百度百科的页面导航效果
- jQuery+PHP打造滑动开关效果
- javascript进行四舍五入方法汇总
- javascript 判断整数方法分享
- 使用jQuery不判断浏览器高度解决iframe自适应高度问题