Skip to content
Advertisement

Tag: flickity

Add class only on first carousel-cell (flickity)

i would have the class “opacity” inserted only at the first “carousel-cell”. For the rest in the loop, they should not be there. Answer You could use the $loop->first variable to add a class only on the first iteration of the loop. Like this: <div class=”carousel-cell {{ $loop->first ? ‘opacity’ : ” }}”> See more here: https://laravel.com/docs/9.x/blade#the-loop-variable

Advertisement