0

I am working with Bootstrap and EE 3.4.5 Grid and need a little help on the carousel.

With the following code all instances of the slide have class 'active'

<div id="myCarousel" class="carousel slide" data-ride="carousel"> 
  <!-- Indicators -->

  <ol class="carousel-indicators">
    <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
    <li data-target="#myCarousel" data-slide-to="1"></li>
    <li data-target="#myCarousel" data-slide-to="2"></li>
  </ol>


  <div class="carousel-inner">
    {slider}
    <div class="item {if count == 1}active{/if}"> <img src="{slider:photo}" style="width:100%" alt="First slide">
      <div class="container">
        <div class="carousel-caption">
          <h1>{slider:title}</h1>
          <p>{slider:sub_title}</p>
          <p><a class="btn btn-lg btn-primary" href="{slider:links_to}" role="button">{slider:button_text}</a></p>
        </div>
      </div>
    </div>
    {/slider}
 </div><!-- /.carousel-inner -->

If I remove {if count == 1}active{/if} the carousel disappears, but I only need active on the first slide. Any suggestions?

0

I just realized that because it is in a grid it requires the following:

{if slider:count == 1}active{/if}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.