金狮镖局 Design By www.egabc.com

本文实例讲述了jquery队列函数用法。分享给大家供大家参考。具体实现方法如下:

复制代码 代码如下:<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/UploadFiles/2021-04-02/jquery-1.9.1.js"> </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程序设计的学习有所帮助。

标签:
jquery,队列,函数,用法

金狮镖局 Design By www.egabc.com
金狮镖局 免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
金狮镖局 Design By www.egabc.com

评论“jquery队列函数用法实例”

暂无jquery队列函数用法实例的评论...