I am stuck on this what I am trying to do is: there will be div's with the class of feature there could be an x amount of them but i only want 5 most resent. take the img src and a.html witch is a title link from each and add each one to 5 containing divs at the top of the page. the image as a background-image and the other prepend to an a tag. this is doing almost that but it takes the last image it finds and places that in each of the 5 containing divs and takes the title's it finds and also places each one in all 5 divs in other words its repeating when each containing div should be unique any help would be appreciated.
$(document).ready(function() {
$('html body').find('.feature').each(function(e) {
var post_image = $(this).find('img').attr('src');
var post_title = $(this).find('a').html();
$('.place_post_feature').each(function() {
$(this).css({
'backgroundImage': 'url(' + post_image + ')',
'backgroundRepeat': 'no-repeat',
'backgroundPosition': 'center',
});
$(this).find('a.preview').prepend(post_title);
});//end each
});//end find each
});//end ready