JSFiddle - React, Tailwind, and code Playground

HTML

<div class="container">
<div class="inside"></div>
</div>

CSS

.container {
    position: relative;
    width: 200px;
    height: 200px;
    background: red;
}

.inside {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    display: none;
}

JavaScript

$('.container').on('mouseenter', function(){
    $(this).find('.inside').fadeIn(500);
});
    
$('.container').on('mouseleave', function(){
    $(this).find('.inside').fadeOut(500);
});