首页 > jquery 同时绑定hover 和click事件,但只有click事件可以触发?

jquery 同时绑定hover 和click事件,但只有click事件可以触发?

$('.dropdown').on('click hover', '.dropdown-icon', function() {
        $(this).parent().next('.dropdown-menu').toggle();
    });

只有click事件可以触发,hover不起作用


并不存在hover这个事件
JQuery的hover方法是mouseenter和mouseleave事件的简略写法罢了


Calling $(selector).hover(handlerInOut) is shorthand for:

$( selector ).on( "mouseenter mouseleave", handlerInOut );

【热门文章】
【热门文章】