【发布时间】:2015-10-12 09:44:16
【问题描述】:
Page A
Page A 1
Page A 2
Page B
Page C
我需要 mMenu 跟随当前页面,所以如果我进入 Page A 2,我希望菜单自动打开该子菜单。
检查了插件,但找不到任何东西来实现这一点。有什么建议吗?
【问题讨论】:
标签: mmenu
Page A
Page A 1
Page A 2
Page B
Page C
我需要 mMenu 跟随当前页面,所以如果我进入 Page A 2,我希望菜单自动打开该子菜单。
检查了插件,但找不到任何东西来实现这一点。有什么建议吗?
【问题讨论】:
标签: mmenu
这似乎是在 Mmenu 中查找此配置设置的常见问题,但您可以通过以下方式将 Mmenu 初始化为默认为当前页面:使用 classNames 中的 selected 配置设置。
$("#menu").mmenu({
//Options
"offCanvas": {
"zposition": "front" //Just an example option
}
}, {
//Configuration
classNames: {
selected: "current-page" //Change this class to match the default li you want
}
});
【讨论】: