You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
1.8 KiB
1 lines
1.8 KiB
(function(e,t,i,n){e.fn.accordion=function(t){var i=e.extend(!0,{},e.fn.accordion.settings,t),o=arguments||!1;return e(this).each(function(){var t,s=e(this),c=s.find(i.selector.title),a=(s.find(i.selector.icon),s.find(i.selector.content)),r=s.data("module"),l=i.className;return t={initialize:function(){c.on("click",t.change),s.data("module",t)},change:function(){var n=e(this),o=(n.next(a),n.hasClass(l.active));o?i.collapsible&&e.proxy(t.close,n)():e.proxy(t.open,n)()},open:function(){var t=e(this),n=t.next(a),o=c.filter("."+l.active),s=o.next(c);i.exclusive&&o.size()>0&&(o.removeClass("active"),s.stop().slideUp(i.speed,i.easing,function(){e(this).removeClass("active").removeAttr("style")})),t.addClass(l.active),n.hide().addClass(l.active).stop().slideDown(i.speed,i.easing,function(){e(this).removeAttr("style")})},close:function(){var t=e(this),n=t.next(a);t.removeClass(l.active),n.removeClass(l.active).show().stop().slideUp(i.speed,i.easing,function(){e(this).removeAttr("style")})},debug:function(e){i.debug&&console.info(i.moduleName+": "+e)},error:function(e){console.warn(i.moduleName+": "+e)},invoke:function(o,s,c){var a;return c=c||Array.prototype.slice.call(arguments,2),"string"==typeof o&&r!==n&&(o=o.split("."),e.each(o,function(n,o){return e.isPlainObject(r[o])?(r=r[o],!0):e.isFunction(r[o])?(a=r[o],!0):(t.error(i.errors.method),!1)})),e.isFunction(a)?a.apply(s,c):a}},r!==n&&o?("invoke"==o[0]&&(o=Array.prototype.slice.call(o,1)),t.invoke(o[0],this,Array.prototype.slice.call(o,1))):(t.initialize(),n)}),this},e.fn.accordion.settings={moduleName:"Accordion",debug:!1,exclusive:!0,collapsible:!0,errors:{method:"The method you called is not defined"},className:{active:"active",hover:"hover"},selector:{title:".title",icon:".icon",content:".content"},speed:500,easing:"easeInOutQuint"}})(jQuery,window,document);
|