JSFiddle - React, Tailwind, and code Playground
HTML
<div class="el1">
This is the first item
</div>
<div class="el2">
This is the second
</div>
CSS
.el1, .el2 {
position:absolute;
border: 1px solid green;
padding: 1rem;
}
.el1 {
background: grey;
}
.el2{
display: none;
background: red;
}
JavaScript
$(function(){
var $el1 = $('.el1'), $el2 = $('.el2');
$el1.fadeOut(function(){
$el2.fadeIn();
});
})