Get the even rows of a repeater using loop.index

Thanks @ChehakWadhdwa - I think I should provide more information as I’m not understanding how your suggestion will accomplish what I’m trying to create.

I have a vertical animated timeline that reveals itself on page scroll. I want the repeater fields to alternate its starting animation either from the left or from the right. So what I need is for all the odd repeater fields to have the class “js--fadeInLeft” and all the even repeater fields to have the class “js--fadeInRight”. Below is the code I’m using for reference:

 {% for item in module.timeline_item %}
 <div class="timeline-item">
 <div class="timeline-content {% if loop.index == '2' %}js--fadeInRight{% else %}js--fadeInLeft{% endif %}">
 <h5>{% inline_text field="timeline_title" value="{{ item.timeline_title }}" %}</h5>
 {% inline_rich_text field="timeline_content" value="{{ item.timeline_content }}" %}
 </div>
 </div>
 {% endfor %}

This module is for a client so I need to have them only editing the content of the repeater and not class names and stylesheets.

Thanks