zoukankan      html  css  js  c++  java
  • jQuery clearQueue

    clearQueue()方法与clearQueue()方法结合;

    .clearQueue()可用于删除通过.queue()方法添加到通用jQuery序列的任何函数。

    示例:

    <!DOCTYPE html>
    <html>
    <head>
      <style>
      div { margin:3px; 40px; height:40px;
        position:absolute; left:0px; top:30px; 
        background:green; display:none; }
      div.newcolor { background:blue; }
      </style>
    
      <script type="text/javascript" src="/jquery/jquery.js"></script>
    </head>
    
    <body>
    
    <button id="start">开始</button>
    <button id="stop">停止</button>
    <div></div>
    
    <script>
    $("#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").clearQueue();
      $("div").stop();
    });
    </script>
    
    
    </body>
    </html>
    
  • 相关阅读:
    SQLServer 知识点
    Entity转换为ViewModel时提供的一种转换方法
    Linq中IGrouping转换为IQueryable
    封装整形属性时对应到枚举
    新的转换列表方式
    工作态度
    EasyFrame
    NewCloud
    将博客搬至CSDN
    Html的语义化
  • 原文地址:https://www.cnblogs.com/sntetwt/p/3939189.html
Copyright © 2011-2022 走看看