<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) 跳转到队列中所有动画的末尾

        jQuery stop(true, true) to jump to end of all animations in queue(jQuery stop(true, true) 跳转到队列中所有动画的末尾)
        <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) 跳转到队列中所有动画的末尾的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Fetch multiple links inside foreach loop(在 foreach 循环中获取多个链接)
                  Backbone Fetch Request is OPTIONS method(Backbone Fetch Request 是 OPTIONS 方法)
                  Fetch API leaks memory in Chrome(Fetch API 在 Chrome 中泄漏内存)
                  How can I download and save a file using the Fetch API? (Node.js)(如何使用 Fetch API 下载和保存文件?(Node.js))
                  Send blob data to node using fetch, multer, express(使用 fetch、multer、express 将 blob 数据发送到节点)
                  Sending a custom User-Agent string along with my headers (fetch)(发送自定义用户代理字符串以及我的标头(获取))

                    <tbody id='5PMd4'></tbody>
                  <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>