<bdo id='Z2KUj'></bdo><ul id='Z2KUj'></ul>
  • <small id='Z2KUj'></small><noframes id='Z2KUj'>

    <legend id='Z2KUj'><style id='Z2KUj'><dir id='Z2KUj'><q id='Z2KUj'></q></dir></style></legend>

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

        jquery 多个事件处理程序

        时间:2023-09-04
      1. <i id='RBFl5'><tr id='RBFl5'><dt id='RBFl5'><q id='RBFl5'><span id='RBFl5'><b id='RBFl5'><form id='RBFl5'><ins id='RBFl5'></ins><ul id='RBFl5'></ul><sub id='RBFl5'></sub></form><legend id='RBFl5'></legend><bdo id='RBFl5'><pre id='RBFl5'><center id='RBFl5'></center></pre></bdo></b><th id='RBFl5'></th></span></q></dt></tr></i><div id='RBFl5'><tfoot id='RBFl5'></tfoot><dl id='RBFl5'><fieldset id='RBFl5'></fieldset></dl></div>
      2. <small id='RBFl5'></small><noframes id='RBFl5'>

      3. <tfoot id='RBFl5'></tfoot>
        <legend id='RBFl5'><style id='RBFl5'><dir id='RBFl5'><q id='RBFl5'></q></dir></style></legend>

            <tbody id='RBFl5'></tbody>

            • <bdo id='RBFl5'></bdo><ul id='RBFl5'></ul>

                  本文介绍了jquery 多个事件处理程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我已经根据我正在处理的最新项目中的类名定义了事件处理程序.

                  I have defined event handlers according to their classnames in the latest project that I'm working on.

                  例如.所有具有类名foo"的元素都应以特定方式响应更改事件.并且所有类名为bar"的元素都应该以其他方式响应.

                  for ex. all element with the class name "foo" should respond in a particular way on change event. and all elements with the class name "bar" should respond in some other way.

                  现在我的一些元素属于两个类,即 class="foo bar",它们应该以两种方式响应.目前,只有一个事件处理函数被调用.

                  Now some of my elements fall under both classes i.e. class="foo bar" and they should respond in both ways. Right now, only one of the event handler function is being called.

                  如何让两个响应同时执行.

                  How can I make both the responses execute simultaneously.

                  推荐答案

                  这取决于你如何绑定事件.如果您通过 jQuery 绑定它们而不是通过 x.onchange = function() { ... } 覆盖处理程序 - 所有绑定的事件处理程序都将被执行.这是因为 jQuery queues 事件处理程序而不是 覆盖 以前的绑定.

                  It depends on how you are binding the events. If you are binding them via jQuery and not overwriting the handlers via x.onchange = function() { ... } - all the bound event handlers will get executed. This is because jQuery queues the event handlers instead of overwriting the previous binding(s).

                  检查此 fiddle 以查看 多个事件被触发:

                  检查此 fiddle 以查看事件处理程序如何被覆盖导致只有最后一个绑定的处理程序触发

                  这篇关于jquery 多个事件处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                    <tbody id='6SaCY'></tbody>

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

                          <tfoot id='6SaCY'></tfoot>
                          <legend id='6SaCY'><style id='6SaCY'><dir id='6SaCY'><q id='6SaCY'></q></dir></style></legend>