Owl Carousel 2 - 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! 回答1: You can use translated.owl.carousel event for that Here is a working Fiddle owl.on('translated.owl.carousel', function(event) {