简体   繁体   English

我使用sb admin2,但是由于metis菜单,我不知道侧栏不起作用

[英]I use sb admin2, but i don't know that side bar is not working because of metis menu

my side bar is not working. 我的侧边栏不起作用。

  • No collpase 没有colpase
  • No resize 不调整大小

because 因为

Uncaught TypeError: undefined is not a function sb-admin-2.js:3(anonymous function) sb-admin-2.js:3j jquery.js:3094k.fireWith jquery.js:3206n.extend.ready jquery.js:3412I jquery.js:3428
Uncaught TypeError: undefined is not a function (index):679(anonymous function) (index):679fire jquery.js:974self.fireWith jquery.js:1084jQuery.extend.ready jquery.js:406DOMContentLoaded

I think that In sb-admin-2.js, 我认为在sb-admin-2.js中,

$(function() {

    $('#side-menu').metisMenu();

});

is not working and Uncaught TypeError: undefined is not a function 无法正常工作并且出现TypeError错误:undefined不是一个函数

I hope... I will be helped... 希望...会有所帮助...

Make sure you have loaded jquery first, then sb-admin-2.js. 确保先加载了jquery,然后加载了sb-admin-2.js。 Also make sure you only load them once. 还要确保只加载一次。

I had the same problem and found that I had accidentally loaded both jquery and sb-admin-2.js twice, once directly with a tag and once as part of a bundle of multiple javascript files. 我遇到了同样的问题,发现我不小心同时加载了jquery和sb-admin-2.js两次,一次直接使用标记,一次作为多个JavaScript文件捆绑的一部分。 I think loading jquery twice was the culprit in my case. 我认为两次加载jquery是我的罪魁祸首。

Call Metis after the view is initialised and also Make sure you have the ordered your JS libraries in correct order. 初始化视图后,请调用Metis,并确保以正确的顺序订购了JS库。 For me the sequence is as follows: 对我来说,顺序如下:

<script src="/js/jquery.js"></script>
<script src="/js/jquery.3.1.1.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="/assets/global/plugins/select2/js/select2.js" type="text/javascript"></script>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我想使用DataTables列搜索。 但是我不知道服务器端代码应该如何 - I want to use DataTables column search. But I don't know how should be server side code 悬停不起作用,我不知道为什么 - Hover not working and I don't know why jQuery的隐藏无法正常工作,我不知道为什么 - Jquery hide is not working , i don't know why fadeIn,fadeOut 不起作用(或者我不知道如何使它起作用) - fadeIn, fadeOut not working (or I don't know how to make it work) 我不知道该怎么办,因为发生错误-&gt; Uncaught TypeError:无法读取null的属性&#39;getContext&#39; - I don't know what to do because an error occurs --> Uncaught TypeError: Cannot read property 'getContext' of null 标签菜单(链接)脚本,但我不知道在何处插入动作(javascript) - Tab menu (a links) script and I don't know where to insert an action (javascript) SB Admin 2 侧边栏菜单在加载时扩展 - SB Admin 2 Sidebar menu expands on load 我不知道我是否使用按钮id jquery ajax序列化正确,但是不起作用 - I don't know if I use button id jquery ajax serialize right, but doesn't work jQuery无法在html中工作,我不知道自己在做什么错 - jQuery not working in html and I don't know what i'm doing wrong 我正在努力在 javascript 中追加行,但我实际上不知道如何在行单元格中添加 append 图像 - I am working on appending row in javascript but I actually don't know how to append an image in row cell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM