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();
});
Make sure you have the correct scripts on the page. The original scripts. I removed a script and it stopped working.
检查cdn和jquery文件的加载顺序...将其从布局默认位置的底部移到顶部有助于我
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.