【问题标题】:Make menu follow current page使菜单跟随当前页面
【发布时间】:2015-10-12 09:44:16
【问题描述】:
Page A
  Page A 1
  Page A 2
Page B
Page C

我需要 mMenu 跟随当前页面,所以如果我进入 Page A 2,我希望菜单自动打开该子菜单。

检查了插件,但找不到任何东西来实现这一点。有什么建议吗?

【问题讨论】:

    标签: mmenu


    【解决方案1】:

    这似乎是在 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
        }
    });
    

    【讨论】:

      猜你喜欢
      • 2015-06-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-19
      • 1970-01-01
      • 1970-01-01
      • 2023-03-09
      相关资源
      最近更新 更多