0
Good morning!
I am using the Owl-Carousel plugin that has several items. I need to get the first and last item on the first page, but I’m not getting it.
Carousel renders this way:
<div class="owl-stage">
<div class="owl-item cloned">
</div>
<div class="owl-item cloned">
</div>
<div class="owl-item cloned">
</div>
<div class="owl-item active"> (quero pegar esse)
</div>
<div class="owl-item active">
</div>
<div class="owl-item active"> (quero pegar esse)
</div>
<div class="owl-item cloned">
</div>
<div class="owl-item cloned">
</div>
<div class="owl-item cloned">
</div>
</div>
The first page items are those that have the .active. I’ve tried a few ways and it doesn’t work:
.owl-stage .owl-item.active:first-child {
border:red;
}
.owl-stage .active:first-child {
border:red;
}
.owl-item.active:first-child {
border:red;
}
I cannot use Nth-Child(n) because the quantity of items varies a lot. So I need to do it in a way that always takes the first and the last. active, regardless of how many items you have.
BS.: sorry for lack of accent, I’m using a vm and the keyboard is disfigured... :(
Thank you! I’ll try!
– Amanda Vieira
Need only comment on!
– NoobSaibot