metisMenu banding show.metisMenu() execute twice ,dispose don't work
amgm-coder opened this issue · 0 comments
amgm-coder commented
function test() {
$('#menu').metisMenu().on('show.metisMenu', function (event) {
console.log($(event.target).parent('li').children('a').html());
});
$('#menu').metisMenu('dispose');
$('#menu').metisMenu().on('show.metisMenu', function (event) {
console.log($(event.target).parent('li').children('a').html());
});
}
菜单已经创建好. 调用test() 绑定 show.metisMenu() 方法时,按照上面的写法 会执行两次 console.log(.....). ????难道$('#menu').metisMenu('dispose');不是 应该解除绑定吗?
期待回复!