JSFiddle - React, Tailwind, and code Playground
HTML
<div class="bgAnchor" data-style="background:url('http://it.bing.com/az/hprichbg?p=rb%2fNewRiverGorgeBridge_ROW468427072.jpg') no-repeat;background-position:0px 0px;">sadsad</div>
<div class="bgAnchor" data-style="background:url('http://it.bing.com/az/hprichbg?p=rb%2fPalmFrond_ROW2095872384.jpg') no-repeat;background-position:0px 0px;">asdsad</div>
<div class="bgAnchor" data-style="background:url('http://it.bing.com/az/hprichbg?p=rb%2fJacksonSquare_ROW1364682631.jpg') no-repeat;background-position:0px 0px;">asdsad</div>
<div class="bgAnchor" data-style="background:url('http://it.bing.com/az/hprichbg?p=rb%2fAustraliaClouds_ROW1600390948.jpg') no-repeat;background-position:0px 0px;">asds</div>
CSS
.bgAnchor{
float:left;
width:958px;
height:512px;
display:block;
}
JavaScript
$('.bgAnchor').each(function(){
if($(this).is(":visible")){
var data_style = $(this).attr('data-style');
if(data_style!== 'undefined' && data_style!== false){
var attr_image = $(this).attr("data-style");
$(this).removeAttr("data-style");
$(this).attr('style',attr_image);
}
}
});