Okay
  Public Ticket #1107221
Layerslider 6 Callbacks (jQuery)
Closed

Comments

  •  2
    gonzaloandrade started the conversation

    I checked the documentation on callbacks here: https://layerslider.kreaturamedia.com/documentation/ but it says that I should use the events on the sitebuilder. (Which I cannot access since I have the jQuery version of the plugin). I only want an example on how should I use callbacks on the jQuery version.

    I’ve been trying stuff like this with no sucess:

    $('#layerslider').layerSlider({
    autoStart: true,
    firstSlide: 1,
    skin: 'borderlesslight',
    showCircleTimer: false,
    slideChangeDidStart: function(element) {
        console.log('function called');
    }
    

    Any help would be appreciated.

  • [deleted] replied

    Hey gonzaloandrade,

    Yes, there is indeed a mixup in the current version's documentation, but we have just released a new update (currently waiting for Envato's approval) that will also fix this.

    We are relying on jQuery's event handling functions, so they are fully compatible. You should use the .on() function for bind events.

    // Binding event
    $('#slider').on('slideChangeDidStart', function(event, slider) {
        // Your code ...
    });
     
    // Initializing the slider
    $('#slider').layerSlider({
        // Your settings ...
    });


  •  2
    gonzaloandrade replied

    Thanks!!