加载 页面 中js 方法

js 文件中

var mingchen= mingchen|| {
    init: function (){

  }

};

文件中

 mingchen.init();

注意问题:

在新加载 页面中      jquery 页面再次加载时      事件有可以不可用,,需要重新再加载

具体写法为:

    $(document).on('mouseenter', '唯一标示', function (event) {
     $(this).next().collapse('show');
 }).on('mouseleave', '唯一标示', function (event) {
     $(this).next().collapse('hide');
 });

原文地址:https://www.cnblogs.com/weixing/p/4500496.html