set activated item owlcarousel2 laravel
AsmaaOIsako opened this issue · comments
Hi guys hope everyone doing great!! in my laravel project am looping with foreach and in item number 10 i want to add active class on it. Am showing 1 item in my owl casourel and i want the item that i add active class to be showed in my page not from the first item When i try to add the active class in div item via "if" condition and check my page i find it removed and start with first item :(
the code am using :
@foreach($weeks as $key => $w)
@php
$str = ltrim($w->weekNumber, 'S');
@endphp
@if($w->fromTo == $today)
<div class="owl-item active aaaaaaaaaaaaaa">
<a id="discbtn" class="btn btn-info btn-user btn-block">
SEMAINE N°{{$str}} - DU {{$w->fromTo}}
</a>
</div>
@else
<div class="owl-item">
<a id="discbtn" class="btn btn-primary btn-user btn-block">
SEMAINE N°{{$str}} - DU {{$w->fromTo}}
</a>
</div>
@endif
@endforeach
I try to add "active" class with if condition but is not working