0

I am using the mmenu plugin for building an app like page. (Link - http://mmenu.frebsite.nl/)

On the advanced page, (http://mmenu.frebsite.nl/mmenu-3.0.2/docs/examples/advanced.html), if i add an li to the option Work Colleagues and hide it using inline style display:none, the counter still increases by one, which isn't ideal.

Is there any event listener / events which can allow this, programatically updating the menus and keep the correct count.

web-nomad
  • 6,003
  • 3
  • 34
  • 49

1 Answers1

1

The plugin will count all LIs (visible or not) that does not have one of these classes:

  1. mm-label
  2. mm-subtitle
  3. mm-noresults
  4. mm-noresult

The first 3 are used by the plugin for visual purposes, the fourth (mm-noresult) is used to hide it from the search results. So instead of adding display: none, you should add class="mm-noresult".

To update the counters, trigger their "count" custom event:

$("#menu em").trigger( "count" );

Regards, Fred

Fred
  • 512
  • 3
  • 6