Stephen Stephen - 6 months ago 47
jQuery Question

How can I extend a Slick carousel function?

I would like to extend the pause function in slick.

Here is what I have so far, but I am unable to access the pause function with

(function ($) {
var _original = $.fn.slick.prototype.pause;

function trigger(target, name, relatedTarget) {
target.trigger($.Event(name, { relatedTarget: relatedTarget }));

$.extend($.fn.slick.Constructor.prototype, {
pause: function () {

Anyway I could do this?


If you look at the end of the source code, you'll see that the JQuery exposed function isn't actually the Slick object, but a function using it.

As far as my understanding of this goes, I'd say what you want to extend is enclosed in an inaccessible closure, which renders answers such as this one unfeasible.