Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set activated item owlcarousel2 laravel #2900

Closed
AsmaaOIsako opened this issue Nov 16, 2022 · 0 comments
Closed

set activated item owlcarousel2 laravel #2900

AsmaaOIsako opened this issue Nov 16, 2022 · 0 comments

Comments

@AsmaaOIsako
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant