Stephen Stephen - 1 year ago 117
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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download