JSFiddle - React, Tailwind, and code Playground
HTML
<div id="some_target"></div>
CSS
#some_target {
position: absolute;
width: 100%; height: 100% ;
}
JavaScript
$(document).ready(function() {
var newImage = "http://vanusasousa.com.br/sicom/img/background2.jpg"; //Image name
$("#some_target").hide().css('background', 'url(' + newImage + ')');
var $img = $("<img>").attr('src', newImage).one('load', function () {
$("#some_target").fadeIn();
});
if ($img.get(0).complete) {
$("#some_target").fadeIn();
}
});