JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.0.0-beta.2.4/owl.carousel.min.js"></script>
<div id="multiple-carousel" class="carousel-style owl-carousel">
<div class="item">
<img src="http://placehold.it/120x180">
<button class = "imagebutton">
select image
</button>
</div>
<div class="item">
<img src="http://placehold.it/270x180">
<button class = "imagebutton">
select image
</button>
</div>
<div class="item">
<img src="http://placehold.it/269x180">
<button class = "imagebutton">
select image
</button>
</div>
<div class="item">
<img src="http://placehold.it/270x180">
<button class = "imagebutton">
select image
</button>
</div>
<div class="item">
<img src="http://placehold.it/120x180">
<button class = "imagebutton">
select image
</button>
</div>
<div class="item">
<img src="http://placehold.it/269x180">
<button class = "imagebutton">
select image
</button>
</div>
<div class="item">
<img src="http://placehold.it/120x180">
<button class = "imagebutton">
select image
</button>
</div>
<div class="item">
<img src="http://placehold.it/270x180">
<button class = "imagebutton">
select image
</button>
</div>
<div class="item">
<img src="http://placehold.it/269x180">
<button class = "imagebutton">
select image
</button>
</div>
</div>
CSS
/*
* Owl Carousel - Animate Plugin
.owl-carousel .animated {
-webkit-animation-duration: 1000ms;
animation-duration: 1000ms;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
.owl-carousel .owl-animated-in {
z-index: 0;
}
.owl-carousel .owl-animated-out {
z-index: 1;
}
.owl-carousel .fadeOut {
-webkit-animation-name: fadeOut;
animation-name: fadeOut;
} */
@-webkit-keyframes fadeOut {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@keyframes fadeOut {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
/*
* Owl Carousel - Auto Height Plugin
*/
.owl-height {
-webkit-transition: height 500ms ease-in-out;
-moz-transition: height 500ms ease-in-out;
-ms-transition: height 500ms ease-in-out;
-o-transition: height 500ms ease-in-out;
transition: height 500ms ease-in-out;
}
/*
* Core Owl Carousel CSS File
*/
.owl-carousel {
display: none;
width: 100%;
-webkit-tap-highlight-color: transparent;
/* position relative and z-index fix webkit rendering fonts issue */
position: relative;
z-index: 1;
}
.owl-carousel .owl-stage {
position: relative;
-ms-touch-action: pan-Y;
}
.owl-carousel .owl-stage:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
.owl-carousel .owl-stage-outer {
position: relative;
overflow: hidden;
/* fix for flashing background */
-webkit-transform: translate3d(0px, 0px, 0px);
}
.owl-carousel .owl-controls .owl-nav .owl-prev,
.owl-carousel .owl-controls .owl-nav .owl-next,
.owl-carousel .owl-controls .owl-dot {
cursor: pointer;
cursor: hand;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.owl-carousel.owl-loaded {
display: block;
}
.owl-carousel.owl-loading {
opacity: 0;
display: block;
}
.owl-carousel.owl-hidden {
opacity: 0;
}
.owl-carousel .owl-refresh .owl-item {
display: none;
}
.owl-carousel .owl-item...
JavaScript
//My script here
$('#multiple-carousel').owlCarousel({
center: true,
items: 3,
autoWidth: true,
loop: true,
margin: 20,
mouseDrag: false,
responsiveRefreshRate: 0,
nav: true
});
$('#multiple-carousel').on('click', '.item .imagebutton', function () {
alert("click");
});