I am adding css background to multiple divs and I want to do it in a row and one after another. Now that I add css to all divs, it adds all the background-images to all divs at once which makes the images to load slowly.
this is my jquery code :
$('#m-portfolio .slick-slide').each(function(){
var $item = $(this),
img = $item.find('.m-p-view').attr('data-lazyload'),
bg = $item.find('.m-p-view').attr('data-bg');
$item.find('div.slice').css('background-image', 'url(' + img + ')');
$item.find('.m-p-view').css('background-image', 'url(' + bg + ')');
});