I'm trying to recreate this tooltip link with jQuery.
$(document).ready(function(){
$(".tooltip").mousemove(function(event) {
$(".text").style.top = (event.pageY + 20) + "px";
$(".text").style.left = (event.pageX + 20) + "px";
});
});
.tooltip {
position: relative;
}
.tooltip span {
display:none;
}
.tooltip:hover span {
display:block;
position:fixed;
overflow:hidden;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><divclass="tooltip">
<span class="text">Texto</span>
<p>Passe o mouse aqui.</p>
</div>
However, Text does not track the movement of the mouse. Could someone tell me how to do this?