Adding animated captions to Owl carousel

user736129 picture user736129 · Nov 18, 2013 · Viewed 20.7k times · Source

I'm using Owl Carousel and have been trying to add animated captions (just a simple fadein on slide display) but can't seem to figure out how to do it.

I have the opacity of all the captions set to 0 and then add a class named "animate-me" (with jQuery) to the captions. The first one fades in and then all the others are constantly displayed.

Here's what I have so far on jsbin... http://jsbin.com/OGehUKEh/3/edit

Answer

Dennis Johnsen picture Dennis Johnsen · Feb 11, 2014

You need to use Owl Carousel callbacks. I found the callbacks you need.

$("#owl-example").owlCarousel({
    beforeMove: function(){
        // BEFORE going to the next slide (hide captions)
    }, 
    afterMove: function(){
        // AFTER going to next slide (show captions)
    }
})