JSFiddle - React, Tailwind, and code Playground
HTML
<div class='a'>Hover over this. The window has to be active.</div>
<div class='b'>I'm here!</div>
CSS
body {
position: relative;
}
div {
width: 100px;
height: 100px;
position: absolute;
}
.a {
background: #777;
left: 50px;
top: 30px;
}
.b {
display: none;
background: #000;
color:#FFF;
left: 250px;
top: 100px;
}
JavaScript
$(function() {
$("div.a").hover(function() {
$(document).keydown(function() {
$("div.b").show();
});
}, function() {
$(document).unbind("keydown");
$("div.b").hide();
});
});