<legend id='KArqw'><style id='KArqw'><dir id='KArqw'><q id='KArqw'></q></dir></style></legend>
      <i id='KArqw'><tr id='KArqw'><dt id='KArqw'><q id='KArqw'><span id='KArqw'><b id='KArqw'><form id='KArqw'><ins id='KArqw'></ins><ul id='KArqw'></ul><sub id='KArqw'></sub></form><legend id='KArqw'></legend><bdo id='KArqw'><pre id='KArqw'><center id='KArqw'></center></pre></bdo></b><th id='KArqw'></th></span></q></dt></tr></i><div id='KArqw'><tfoot id='KArqw'></tfoot><dl id='KArqw'><fieldset id='KArqw'></fieldset></dl></div>

      1. <small id='KArqw'></small><noframes id='KArqw'>

      2. <tfoot id='KArqw'></tfoot>

          <bdo id='KArqw'></bdo><ul id='KArqw'></ul>

        jQuery stop(true, true) 跳转到队列中所有动画的末尾

        时间:2023-09-29
        <legend id='ihdCL'><style id='ihdCL'><dir id='ihdCL'><q id='ihdCL'></q></dir></style></legend>
      3. <i id='ihdCL'><tr id='ihdCL'><dt id='ihdCL'><q id='ihdCL'><span id='ihdCL'><b id='ihdCL'><form id='ihdCL'><ins id='ihdCL'></ins><ul id='ihdCL'></ul><sub id='ihdCL'></sub></form><legend id='ihdCL'></legend><bdo id='ihdCL'><pre id='ihdCL'><center id='ihdCL'></center></pre></bdo></b><th id='ihdCL'></th></span></q></dt></tr></i><div id='ihdCL'><tfoot id='ihdCL'></tfoot><dl id='ihdCL'><fieldset id='ihdCL'></fieldset></dl></div>

                <tbody id='ihdCL'></tbody>

              1. <small id='ihdCL'></small><noframes id='ihdCL'>

                <tfoot id='ihdCL'></tfoot>
                  <bdo id='ihdCL'></bdo><ul id='ihdCL'></ul>
                  本文介绍了jQuery stop(true, true) 跳转到队列中所有动画的末尾的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我一直在使用 jQuery 的 stop(true, true) 方法来清除正在运行的动画,以便下一个立即开始.我注意到第一个参数 clearQueue 清除了整个动画队列,但第二个参数 jumpToEnd 只跳转到当前正在运行的动画的末尾,而不是那些已从队列中删除.有没有办法让它清晰并跳转到所有排队动画的末尾?

                  I have been using jQuery's stop(true, true) method to clear running animations so the next one starts immediately. I noticed that the first parameter, clearQueue, clears the entire animation queue but the second parameter, jumpToEnd, only jumps to the end of the currently running animation and not the ones that were removed from the queue. Is there a way to have it clear and jump to the end of all queued animations?

                  我最终链接了几个 stop(false, true) 调用,但是这只会处理 3 个排队的动画,例如.

                  I've ended up chaining a few stop(false, true) calls instead, but this will only handle 3 queued animations, for example.

                  $(this)
                    .stop(false, true)
                    .stop(false, true)
                    .stop(false, true)
                    .addClass('hover', 200);
                  

                  根据 Ates Goral 的回答,我最终添加了自己的方法 stopAll:

                  I ended up adding my own method, stopAll, as per Ates Goral's answer:

                  $.fn.extend({ stopAll: function () {
                      while (this.queue().length > 0)
                        this.stop(false, true);
                      return this;
                    } });
                  

                  $(this).stopAll().addClass('hover', 200);
                  

                  我希望其他人觉得这很有用.

                  I hope someone else finds this useful.

                  推荐答案

                  jQuery 1.9 引入了 .finish() 方法,正是实现了这一点.

                  jQuery 1.9 introduced the .finish() method, which achieves exactly that.

                  这篇关于jQuery stop(true, true) 跳转到队列中所有动画的末尾的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:使用 Javascript 对每 15 秒一次的 ajax 调用进行速率限制和排队 下一篇:从 Laravel 外部推送到 Laravel 队列(NodeJS)

                  相关文章

                  <tfoot id='5PMd4'></tfoot>
                • <i id='5PMd4'><tr id='5PMd4'><dt id='5PMd4'><q id='5PMd4'><span id='5PMd4'><b id='5PMd4'><form id='5PMd4'><ins id='5PMd4'></ins><ul id='5PMd4'></ul><sub id='5PMd4'></sub></form><legend id='5PMd4'></legend><bdo id='5PMd4'><pre id='5PMd4'><center id='5PMd4'></center></pre></bdo></b><th id='5PMd4'></th></span></q></dt></tr></i><div id='5PMd4'><tfoot id='5PMd4'></tfoot><dl id='5PMd4'><fieldset id='5PMd4'></fieldset></dl></div>

                      <small id='5PMd4'></small><noframes id='5PMd4'>

                      • <bdo id='5PMd4'></bdo><ul id='5PMd4'></ul>
                      <legend id='5PMd4'><style id='5PMd4'><dir id='5PMd4'><q id='5PMd4'></q></dir></style></legend>