JSFiddle - React, Tailwind, and code Playground
by Alfie
HTML
<div class="page">
<div class="a">a</div>
<div class="b">b</div>
</div>
CSS
* {
margin:0;
padding:0
}
.page {
padding:60px;
}
.a {
background-color:tan;
width:50px;
height:50px;
color:#fff
}
.b {
background-color:#9E0606;
width:100px;
height:100px;
color:#fff;
display:none;
}
JavaScript
var tOut;
$('.a,.b').hover(function () {
$('.b').show();
clearTimeout(tOut);
}, function () {
tOut= setTimeout(function(){ $('.b').hide();},2000);
});