extend uikit plugin - add code to a function -
i'm using accordion component of uikit , i'm trying extend plugin ... wrote
uikit.on('beforeready.uk.dom', function () { $.extend(uikit.components.accordion.prototype, { init: function () { } });
and init code changing:
init: function() { var $this = this; this.element.on('click.uikit.accordion', this.options.toggle, function(e) { e.preventdefault(); $this.toggleitem(ui.$(this).data('wrapper'), $this.options.animate, $this.options.collapse); }); this.update(); if (this.options.showfirst) { this.toggleitem(this.toggle.eq(0).data('wrapper'), false, false); } },
as can see code can override init function ...however want keep existing init function , add code in it....is possible so? in advance
Comments
Post a Comment