Jquery mmenu - 重置菜单到主级关闭 [英] Jquery mmenu - Reset menu to main level on close

查看:275
本文介绍了Jquery mmenu - 重置菜单到主级关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前有mmenu作为我的手机菜单。我需要能够在关闭时将我的菜单重置为第一级。到目前为止,默认功能让我在关闭菜单并重新打开菜单后进入子级别时,我离开的地方。

I currently have mmenu as my mobile menu. I need to be able to reset my menu to the first level upon close. As of now the default functionality leaves me where I left off while navigating deeper into the sub-level after closing the menu and re-opening it.

我非常感谢帮助这个问题。

I'd greatly appreciate help with this matter.

谢谢!

推荐答案

答案适用于以前版本的Mmenu,但如果您使用的是最新版本(最新的发布时间是5.6.1),您可以使用API​​方法,如下所示:

Fred's answer works on a previous version of Mmenu but if you're using the latest version (latest at the time this was posted was 5.6.1), you can use the API methods like the following:

var api = $("#menu").data( "mmenu" );
api.bind( "closed", function() {
    api.closeAllPanels();
});

这篇关于Jquery mmenu - 重置菜单到主级关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆