Although I am able to display all product images with flex slider on the product details page. Here below is my code of product.liquid file
<div class="preview col-md-6">
{%- if product.media.size > 0 -%}
<div class="productflexslider">
<ul class="slides">
{% for media in product.media %}
<li data-thumb="{{ media.preview_image.src | img_url: 'large' }}">
{% case media.media_type %}
{% when 'external_video' %}
<div class="product-single__video">
{{ media | external_video_tag }}
</div>
{% when 'video' %}
<div class="product-single__video">
{{ media | video_tag: controls: true }}
</div>
{% when 'image' %}
<div class="thumb-image product_grpup_sticker">
{% if product.metafields.custom.markers %}
<img src="{{ product.metafields.custom.markers | img_url: 'large' }}" class="product_sticker" id="variant_image" />
{% endif %}
<img src="{{ media.src | img_url: 'large' }}" class="zoom-images" alt="{{ media.alt | escape }}" id="variant_image" />
</div>
{% endcase %}
</li>
{% endfor %}
</ul>
<div class="clearfix"></div>
</div>
{% else %}
<img src="{{ 'img.jpg' | asset_url }}" class="img-responsive" alt="{{ 'img.jpg' | asset_url }}">
{%- endif -%}
</div>
......
......
{% if product.variants.size > 1 %}
<variant-selects class="no-js-hidden single-option-selector" data-section="{{ section.id }}" data-url="{{ product.url }}" {{ block.shopify_attributes }}>
{%- for option in product.options_with_values -%}
<div class="col-4 col-md-4 product-form__input product-form__input--dropdown">
<label class="form-label" for="Option-{{ section.id }}-{{ forloop.index0 }}">
{{ option.name }}
</label>
<div class="mb-4">
<select id="Option-{{ section.id }}-{{ forloop.index0 }}" class="select__select form-select" name="options[{{ option.name | escape }}]" form="{{ product_form_id }}">
{%- for value in option.values -%}
<option value="{{ value | escape }}" {% if option.selected_value==value%} selected="selected" {% endif %}>
{{ value }}
</option>
{%- endfor -%}
</select>
</div>
</div>
{%- endfor -%}
<script type="application/json">{{ product.variants | json }}</script>
</variant-selects>
{% endif %}
What should I change in code so that onchange of variant from select it’s corresponding image should be highlighted in slider?