使用menu-aim:
https://github.com/hfknight/jQuery-menu-aim/blob/master/jquery.menu-aim.js
有一个问题响应它。它使用mouseenter
,我需要使用click.function() {}
禁用鼠标中心。如果您查看底部插件(上图)中的代码,您会看到以下事件:
$menu
.mouseleave(mouseleaveMenu)
.find(options.rowSelector) // here
.mouseenter(mouseenterRow) // and here
.mouseleave(mouseleaveRow)
.click(clickRow);
$(document).mousemove(mousemoveDocument);
我想在此.click(function (){})
$('[data-toggle="offcanvas"]').click(function () {
});
这是一个不正确的代码,因此您可以更好地理解我想要实现的目标:
$('[data-toggle="offcanvas"]').click(function () {
$(".dropdown-menu").menuAim({
activate: function(){disable mouseenter here }
});
});
答案 0 :(得分:1)
不太明白,但这样你可以off
任何事件。你可以尝试一下:
// For all elements with an identifier
function(){ $('elementIdOrClass').off('mouseenter'); }
// For current element only
function(){ $(this).off('mouseenter'); }
您也可以使用unbind('mouseenter')
。