I am currently using this code to set a div's image background:
$('.sample_image').css('background-image', 'url('+ $(this).attr("src") +')');
We use this so when a user clicks on an image colour swatch, it sets that as the background image so they can get a better view of a product.
The issue is that some image swatches have 2 colours, to show a secondary colour. I need to just display the colour which is on the left hand side (top left pixel.)
Is this possible with JQuery?