Skip to content
Advertisement

Set first bootstrap card (item) as active

I’m using carousel to display data from database and I tried to set first card active but it won’t work and cards are static. Cards works fine without php. I was trying to use boolean variable and set active class with some conditions but it didn’t work.

JavaScript

Advertisement

Answer

You are setting $isFirst = True and then set it in condition to false in each while loop, where’s the sense? Change it to:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement