联系我们
简单又实用的WordPress网站制作教学
当前位置:网站首页 > 网页前端技术 > 正文

jquery队列函数用法实例 - Web前端

作者:98wpeu发布时间:2026-07-06分类:网页前端技术浏览:8


导读:本文实例讲述了JQuery队列函数用法。分享给大家供大家参考。具体实现方法如下:复制代码代码如下:<!DOCtype><html><head>...

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

复制代码 代码如下:<!DOCtype>
<html>
<head>
<metahttp-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程序设计的学习有所帮助。

标签:队列函数实例Webjquery


网页前端技术排行
最近发表
网站分类
标签列表