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>
    
  • 相关阅读:
    Remote API(RAPI)之 文件管理
    vue前端框架

    托马斯彩色回旋
    VUE?
    cookie与session
    ajax前后端分离
    djangoIII
    Django少年
    django三板斧
  • 原文地址:https://www.cnblogs.com/sntetwt/p/3939189.html
Copyright © 2011-2022 走看看