Currently I have a list of elements for an isotope page. The basic markup for an element is:
<div class="element conference-box"> <a href="#"><img src="#" class="conference-image" alt=""></a>
<div class="caption">
<div class="confback"></div>
<h3 class="conference-title"></h3>
<h4 class="conference-details"></h4>
</div>
</div>
There around 30 or so elements on the page.
I've been trying to use jQuery to take the image with the class "conference-image" and apply it as a background image to the .confback div, while retaining the original image. I had some success using this code:
$('.element').each(function() {
var getImageSrc = $('.conference-image').attr('src');
$('.confback').css('background-image', 'url(' + getImageSrc + ')');
return true;
});
However, my script takes the image from the very first element and applies that as the background image for every .confback div in every element on my page. Obviously, I would like each individual element to use the image that has been used in that particular element.