jquery中队列的详细解释,最好有实例,及queue和dequeue的运用。

解决方案 »

  1.   

    额。话说文档你不看吗
    <style>
      div { margin:3px; width:40px; height:40px;
            position:absolute; left:0px; top:30px; 
            background:green; display:none; }
      div.newcolor { background:blue; }
      </style>  <button id="start">Start</button>
      <button id="stop">Stop</button>
      <div></div>
    $("#start").click(function () {
          $("div").show("slow");
          $("div").animate({left:'+=200'},5000);
          $("div").queue(function () {
              $(this).addClass("newcolor");
              $(this).dequeue();
          });
          $("div").animate({left:'-=200'},1500);
          $("div").queue(function () {
              $(this).removeClass("newcolor");
              $(this).dequeue();
          });
          $("div").slideUp();
      });
      $("#stop").click(function () {
          $("div").queue("fx", []);
          $("div").stop();
      });
      

  2.   

    就是没看懂才上这里请高手指点的啊。怎么控制jquery中两个动画在一个元素上同时进行,但是不同时结束。或者说一个动画先开始,另一个在开始,且结束不同时。
      

  3.   

    animate中指定queue为false,多个效果会同时进行。