This is working for radio buttons, selects and checkboxes product options where the options is predefined and saved.
<script type="text/javascript">
// product-options - select
$('.product-options select').change(function() {
console.log($(this).prop('selectedIndex'));
const idx = $(this).prop('selectedIndex');
$('#product-imgs .slick-track .product-preview.slick-slide').not(".slick-cloned")[idx].click();
});
</script>
<script type="text/javascript">
$('.product-options .radio input:radio').each(function(idx, elem) {
console.log(idx);
$(elem).on('click', function() {
if($(this).is(':checked')) {
$('#product-imgs .slick-track .product-preview.slick-slide').not(".slick-cloned")[idx + 1].click();
}
});
});
</script>
<script type="text/javascript">
</script>
<script type="text/javascript">
</script>