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

    1. <tfoot id='P9nSZ'></tfoot>
        <bdo id='P9nSZ'></bdo><ul id='P9nSZ'></ul>

        悬停时的Jquery不起作用

        Jquery on hover not functioning(悬停时的Jquery不起作用)
          <bdo id='Izooi'></bdo><ul id='Izooi'></ul>

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

          <small id='Izooi'></small><noframes id='Izooi'>

              <tbody id='Izooi'></tbody>
              <tfoot id='Izooi'></tfoot>

                • 本文介绍了悬停时的Jquery不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在更改我的代码以与 jQuery 1.8 兼容,但我被这个不起作用的 hover 所困扰.当我将同样的东西与 click 一起使用时,它起作用了.这是我的代码,谁能告诉我哪里出错了?

                  I'm changing my codes to be compatible with jQuery 1.8 and I'm stuck with this hover which doesn't work. When I used then same thing with a click it worked. Here is my code, can anyone tell me where I'm going wrong?

                  $(document).on('hover', '.top-level', function (event) {
                    $(this).find('.actionfcnt').show();
                    $(this).find('.dropfcnt').show();
                  }, function () {
                    $(this).find('.dropfcnt').hide('blind', function () {
                      $('.actionfcnt').hide();
                    });
                  });
                  

                  推荐答案

                  自 jQuery 1.8 起已弃用:名称hover"用作字符串mouseenter mouseleave"的简写.它为这两个事件附加了一个事件处理程序,处理程序必须检查 event.type 以确定事件是 mouseenter 还是 mouseleave.不要混淆悬停"伪事件名称和 .hover() 方法,后者接受一两个函数.

                  Deprecated as of jQuery 1.8: The name "hover" used as a shorthand for the string "mouseenter mouseleave". It attaches a single event handler for those two events, and the handler must examine event.type to determine whether the event is mouseenter or mouseleave. Do not confuse the "hover" pseudo-event-name with the .hover() method, which accepts one or two functions.

                  来源:http://api.jquery.com/on/#additional-notes

                  这几乎说明了一切,你不能使用悬停":

                  That pretty much says it all, you cant use "hover" for that:

                  $(document).on('mouseenter','.top-level', function (event) {
                      $( this ).find('.actionfcnt').show();
                      $( this ).find('.dropfcnt').show();
                  }).on('mouseleave','.top-level',  function(){
                      $( this ).find('.dropfcnt').hide('blind', function(){
                          $('.actionfcnt').hide();
                      });
                  });
                  

                  这篇关于悬停时的Jquery不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Why doesn#39;t CSS hover work on table rows when the cells inside the rows have class names?(当行内的单元格具有类名时,为什么 CSS 悬停在表格行上不起作用?)
                  Hover image - display div over it(悬停图像 - 在其上显示 div)
                  How to apply a CSS class on hover to dynamically generated submit buttons?(如何在悬停时将 CSS 类应用于动态生成的提交按钮?)
                  div hover background-color change?(div 悬停背景颜色变化?)
                  How to change background color and text of hover options in select?(如何更改选择中悬停选项的背景颜色和文本?)
                  Gradient Button to background-color blinks on hover(悬停时背景颜色的渐变按钮闪烁)
                  <tfoot id='MMgt1'></tfoot>
                      1. <i id='MMgt1'><tr id='MMgt1'><dt id='MMgt1'><q id='MMgt1'><span id='MMgt1'><b id='MMgt1'><form id='MMgt1'><ins id='MMgt1'></ins><ul id='MMgt1'></ul><sub id='MMgt1'></sub></form><legend id='MMgt1'></legend><bdo id='MMgt1'><pre id='MMgt1'><center id='MMgt1'></center></pre></bdo></b><th id='MMgt1'></th></span></q></dt></tr></i><div id='MMgt1'><tfoot id='MMgt1'></tfoot><dl id='MMgt1'><fieldset id='MMgt1'></fieldset></dl></div>
                          <bdo id='MMgt1'></bdo><ul id='MMgt1'></ul>
                            <tbody id='MMgt1'></tbody>

                            <small id='MMgt1'></small><noframes id='MMgt1'>

                          1. <legend id='MMgt1'><style id='MMgt1'><dir id='MMgt1'><q id='MMgt1'></q></dir></style></legend>