JavaScript how to show the caption div when current item is focused in owl carousel?

I need to show the caption div when current item is focused. i am able to show the caption but when second last image focused with cation last image also show caption in loop.

In first loop all caption div show when image is focused but after first loop last image already comes with caption. when i keep carousel option loop:True when i keep false i navigate prev and next then i won't get problem . for Refrence: http://jsfiddle.net/ROHIT502/1qdurrLz/95/ Error Image when loop happen Here is the jquery code:

$(document).ready(function () {
$('#slider').on('initialized.owl.carousel change.owl.carousel changed.owl.carousel ', function (e) {
if (!e.namespace || e.type != 'initialized' && e.property.name != 'position') return;
var current = e.relatedTarget.current()
var items = $(this).find('.owl-stage').children()
//alert(current);
var add = e.type == 'changed' || e.type == 'initialized'
items.eq(e.relatedTarget.normalize(current)).toggleClass('current', add)
}).owlCarousel({
items: 3,
margin: 10,
itemsDesktop : [1199,3],
itemsDesktopSmall: [979, 3],
autoplay:true,
autoplayTimeout:2000,
autoplayHoverPause: true,
//autoHeight: true,
responsive: true,
center: true,
dots:false,
nav: true,
loop: true
});
})
Answer:1

I often read that I should not use HTML's onclick attribute because it decrease code readability. Instead I should make event listener in my script.js. So what do you think about v-on:click? Is it ...

I often read that I should not use HTML's onclick attribute because it decrease code readability. Instead I should make event listener in my script.js. So what do you think about v-on:click? Is it ...

I'm working on the router in Vue js. I display the current link in Navbar by adding style for router-link-active and exact property for each <router-link>. It's work fine. But now I'm trying to ...

I'm working on the router in Vue js. I display the current link in Navbar by adding style for router-link-active and exact property for each <router-link>. It's work fine. But now I'm trying to ...

If body is smaller than viewport, then the viewport size is returned. What I am trying to do is resize a picture so that the body fits inside the viewport. I want to have one of those nice "above the ...

If body is smaller than viewport, then the viewport size is returned. What I am trying to do is resize a picture so that the body fits inside the viewport. I want to have one of those nice "above the ...

I've been struggling with this for awhile and can't seem to find anyone else with the same issue. I've got this component and container which are my start screen which should be rendered at the ...

I've been struggling with this for awhile and can't seem to find anyone else with the same issue. I've got this component and container which are my start screen which should be rendered at the ...

  1. invalid prop component of type object supplied to route
  2. invalid prop component supplied to forwardref(buttonbase)
  3. invalid prop component supplied to connectedfield
  4. invalid prop component of type object
  5. invalid prop component supplied to indexroute
  6. invalid prop component supplied to
  7. invalid prop component supplied to field redux form
  8. invalid prop component
  9. invalid prop component of type function supplied to
  10. invalid prop component of type string supplied to route
  11. invalid prop component of type object supplied
  12. invalid prop textfield component supplied to datetextfield
  13. invalid value for prop component on a tag
  14. invalid value for prop component on div tag
  15. invalid value for prop component on input tag