$(document).ready(function() {
$('.product-color ul li').click(function(event) {
var ButtonDiv = jQuery(".color-button-" +Block);
console.log(ButtonDiv);
});
});
$('.color-6').click(function(event) {
var num = $(this).attr('data-num6');
$('.photo-6').removeClass('active');
$('.color-6').removeClass('active');
$(this).addClass('active');
$('.u-'+num).addClass('active');
});
});
//Картинки
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12 product-phone-iphone-7-img img">
<?php
$images = get_field('product_photo',$products->ID);
foreach( $images as $key => $image ){
$key ++;
?>
<img src="<?php echo $image['sizes']['medium_large']; ?>" class="photo-6 u-<?php echo $key; ?>" alt="<?php echo $image['alt']; ?>">
<?php
}
?>
</div>
//кнопки с цветами
<ul>
<?php
$memory = get_field('memory_phone',$products->ID);
foreach( $memory as $key => $memorys ){
$key ++;
// var_dump($memory)
?>
<li class="memory-6 w-<?php echo $key; ?>" data-memory6="<?php echo $key; ?>"><?php echo $memorys['memory']; ?>GB</li>
<?php
}
?>
</ul>