SO - 22057927

by xiaolong li

HTML

<div id="ct">
    <span id="target">trigger</span>
    <div id="e">This is the overlay tooltip content.</div>
</div>

CSS

#ct {
    position: relative;
}
#e {
    position: absolute;
    display: none;
    top: 0;
    left:0;
    z-index: 100;
    background-color: red;
    width: 50px;
}

JavaScript

$('#target').hover(function () {
    console.log('x')
    $('#e').show()
}, function () {
    console.log('y')
    $('#e').hide()
})