简体   繁体   English

jQuery插件功能永远无法实现

[英]jQuery plugin function never gets reached

I'm having trouble with one of my jQuery plugins I'm currently working on, it never reaches the function. 我在使用我目前正在使用的jQuery插件之一时遇到了麻烦,但它从未达到该功能。 Now this isn't my the first plugin I have developed and I get no error, so I'm standing clueless. 现在,这不是我开发的第一个插件,并且没有错误,所以我一无所知。 I've tried to log to see if the function gets reached but without success. 我尝试登录以查看该功能是否达到,但未成功。 Please help me if you know the reason. 如果您知道原因,请帮助我。 Thanks in advance! 提前致谢!

$.fn.accordion = function(options) {
    return this.each(function () {
        if (!$.data(this, "plugin_accordion")) {
            $.data(this, "plugin_accordion", new accordion(this, options));
        }
    });
};

$(".js-accordion-contact").accordion({breakpoint: "smallMedium"});

I managed to figure out yesterday before going to bed, that it must be caused by a plugin name conflict, I realized that this can be the only reason, why it's not working. 昨天我睡前设法弄清楚,这一定是由插件名称冲突引起的,我意识到这可能是唯一的原因,为什么它不起作用。 Somewhere else a plugin with the same name already exists. 在其他地方已经存在具有相同名称的插件。 I'm using Joomla and noticed that jQuery UI has a function with the same name, so I guess After renaming my plugin I finally got it to work. 我正在使用Joomla,并注意到jQuery UI具有相同名称的功能,所以我想在重命名插件后,我终于可以使用它了。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM