Slider Revolution - Run a jQuery script every time each slide loads

3.1k Views Asked by At

I'm not sure if this was asked before but I cannot find an answer trough the internet. I am using Slider Revolution jQuery 5.3 and I want to add a custom animation to one of the layer. My plan is to run a jQuery script every time each slide loads or if users click next/previous button but I don't have any idea how to do that or if it's possible to do.

Example:

$(document).ready(function() {
   if(a slide was loaded){
      console.log('This should be my custom animation code');
   }
})
1

There are 1 best solutions below

0
On BEST ANSWER

This is from the RS documentation:

revapi.on('revolution.slide.onchange', function(event, data) {

    // data.slideIndex   = Current Slide Index (starting with the number zero)
    // data.currentslide = Current Slide as jQuery Object
    // data.prevslide    = Previous Slide as jQuery Object 

});