Using Events (Pro)

Using Events

You can bind functions to the Evo Slider events on run time. All callbacks contains an event object as a function argument. In the callback, the this keyword inside the callback always refers to the same slider scope.

Use .bind() to listen to the Evo Slider events. Example:

<script type="text/javascript">
    var myEvoSlider = $("#mySlider").evoSlider();
    
    // Bind function to the onplay event
    myEvoSlider.bind("onplay", function(){
        var i = this.getIndex();
        alert("Evo Slider start playing on slide " + i);
    });
</script>
                

You can see the list of events in the Events section of this userguide.