JSFiddle - React, Tailwind, and code Playground
by Laxmikant Dange
HTML
<div class="element">
</div>
CSS
html{
width:100%;
height:100%;
}
body{
width:100%;
height:100%;
padding:0px;
margin:0px;
}
.element{
width:100%;
height:100%;
background-image:url('http://i.imgur.com/dBWaKRT.png');
-webkit-transition: background-image 5s;
}
JavaScript
var image = new Image();
image.onload = function () {
$(".element").css("background-image", "url('" + image.src + "')");
}
image.src = "https://c1.staticflickr.com/3/2439/3728897793_ff1c78c5d9.jpg";