1

I am developing an application on angularJS with gentelella admin panel. I have some issues.

 <div class="nav toggle">
    <a href="javascript:;" id="menu_toggle"><i class="fa fa-bars"></i></a>
 </div>

this is html snippet. but toggling not working. I have checked all loaded js files. there I have found $MENU_TOGGLE.on('click') but it is not firing.

EDIT this code from gentelella/custom.js

var $MENU_TOGGLE = $('#menu_toggle');
$MENU_TOGGLE.on('click', function() {
        console.log('clicked - menu toggle');

        if ($BODY.hasClass('nav-md')) {
            $SIDEBAR_MENU.find('li.active ul').hide();
            $SIDEBAR_MENU.find('li.active').addClass('active-sm').removeClass('active');
        } else {
            $SIDEBAR_MENU.find('li.active-sm ul').show();
            $SIDEBAR_MENU.find('li.active-sm').addClass('active').removeClass('active-sm');
        }

    $BODY.toggleClass('nav-md nav-sm');

    setContentHeight();
});
Cœur
  • 37,241
  • 25
  • 195
  • 267
Faradox
  • 183
  • 2
  • 14

3 Answers3

0

Make sure you have the correct scripts on the page. The original scripts. I removed a script and it stopped working.

0

check the order of how cdn and jquery files are loaded...moving that from bottom to head of the layout default helps me

JahStation
  • 893
  • 3
  • 15
  • 35
-1

Try this

 <a href="javascript:;"id="menu_toggle" data-toggle="dropdown" aria-expanded="false"><i class="fa fa-bars"></i></a>

Or you can prefer fiddle

Ravi Ubana
  • 397
  • 5
  • 26