简体   繁体   中英

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. 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.

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.

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