lundi 20 avril 2015

Owl Carousel - caption div (img title & alt tags)

I'm looking for a way to display the img title & alt tags in a div (.image-caption).

This is my code so far:

    owl.on('changed.owl.carousel', function(event) {

        var comment = $(this).find('img').attr('alt');
        var title = $(this).find('img').attr('title');
        if(comment) $('#desktop .image-caption').html('<h4>'+title+'</h4><p>'+comment+'</p>');

    })      

Any ideas? Thanks!

Aucun commentaire:

Enregistrer un commentaire