ngx-owl-carousel icon indicating copy to clipboard operation
ngx-owl-carousel copied to clipboard

On Click event does not work with loop

Open abbasdawood opened this issue 7 years ago • 7 comments

I have the following piece of code

<owl-carousel [options]="owlOptions" [items]="slides" [carouselClasses]="['owl-theme', 'row', 'sliding','ml-auto','mr-auto']" #owlElement>
  <div class="item" *ngFor="let image of slides" (click)="changeMainSlide(image)">
    <div class="nav-content text-white text-capitalize">
      <h6 class="mb-0">
        <small class="d-block">{{image.date | date:'dd MMM'}} <span class="badge badge-pill badge-light text-uppercase small">{{image.type}}</span></small>
        <span class="animated fadeIn">{{image.artistInfo}}</span>
      </h6>
      <small class="d-block"><strong>{{image.plainAddress}}</strong></small>
    </div>
    <img src="{{image.images.slider}}" />
  </div>
</owl-carousel>

The click event fires only when I click the slides that are in view, and not the ones off the stage. My owlOptions also has loop: true set, could this have a possible impact?

abbasdawood avatar Dec 20 '17 11:12 abbasdawood

Facing same issue with below parameters

autoWidth:true,
loop:true

Kindly provide solution

shabbir-dhangot avatar Feb 07 '18 06:02 shabbir-dhangot

@mujtaba01 Figured out that this changes not there on JS file.

Can you do that. https://github.com/OwlCarousel2/OwlCarousel2/pull/2021/files

I manually change in dist folder and able to get click event.

shabbir-dhangot avatar Feb 07 '18 06:02 shabbir-dhangot

Thanks @shabbir-dhangot,

To fix this issue changes have to made in the original owl.carousel.js file and cannot make changes in original owl.carousel.js file. I will include a separate fixed version of the file in the package shortly.

mujtaba01 avatar Feb 08 '18 18:02 mujtaba01

@mujtaba01 Any update on this. This is super important

shabbir-dhangot avatar Mar 05 '18 10:03 shabbir-dhangot

@mujtaba01 no updates???

shabbir-dhangot avatar Apr 11 '18 12:04 shabbir-dhangot

@mujtaba01 Waiting for your update from so long

shabbir-dhangot avatar Jun 22 '18 10:06 shabbir-dhangot

I made the changes in owl.carousel.js dist folder, but (click) doesen`t work yet? Anny idea?

raoulcimpean avatar Dec 03 '19 08:12 raoulcimpean