My question here is based on a product that holds different colours.
If I click on an image I need to be able to change the value of the variable.
At the moment it picks up the parent product colour, however if I click on a different image I need the below $value to change to the tray data that's stored in the image tag.
<img class="product" title="Image 1" tray="A.1.A" src="" />
<img class="product" title="Image 2" tray="A.2.A" src="" />
<img class="product" title="Image 3" tray="A.3.A" src="" />
<?php $value = get_field('product_tray'); ?>
The JavaScript I have been using for the title was the following (works fine) but I need to integrate with the variable this time.
$(".product").live('click', function(){
$("#content").html($(this).attr('title'));
});