Sanjay Makwana
Sanjay Makwana

Reputation: 19

Flickity slider with shopify liquid with add initialIndex from shopify theme code

I used the Flickity slider with Shopify theme now I want to add initialIndex on my code

my liquid code


  <div class="carousel"  data-flickity='{  "initialIndex": 7, "adaptiveHeight": false, "freeScroll":true, "cellAlign": "left", "groupCells": "66%", "contain": true, "pageDots":false, "arrowShape": { "x0": 10,"x1": 70, "y1": 50,"x2": 80, "y2": 40,"x3": 35} }'>
        {% for block in section.blocks %}
        <div class="carousel-cell {% if page.url == block.settings.cs-m-u %}is-active-cs-mmenu{% endif %}" >
          <a data-atrib-index= " {{ forloop.index }}" class="cs-icon-link {% if page.url == block.settings.cs-m-u %}active-cs-menu{% endif %}" href="{{ block.settings.cs-m-u }}">
            <span class="cd-menut-icon">
              {{ block.settings.cs-m-svg }}
            </span>
            <span class="contact-text">{{block.settings.cs-m-tx}}</span>
          </a>
        </div>
        {% endfor %}
      </div>

initialIndex": 7, i want to add based on the data-atrib-index= " {{ forloop.index }}" " this show the for loop active index so this value I need to add into Flickity data-flickity= how I can do that"

Upvotes: 0

Views: 1915

Answers (0)

Related Questions