L'ho fatta al volo e non ho mai usato jQuery in vita mia, quindi è possibile che stia proprio fuori con l'accuso… ma così, per curiosità, prova questo:
codice:
$("a").hover(function(e){
var pXScroll = document.documentElement.scrollLeft || document.body.scrollLeft;
var pYScroll = document.documentElement.scrollTop || document.body.scrollTop;
var toolTWidth = document.getElementById("toltip").offsetWidth;
var toolTHeight = document.getElementById("toltip").offsetHeight;
thXPos = document.body.offsetWidth - e.pageX - pXScroll > toolTWidth ? e.pageX + pXScroll : document.body.offsetWidth - toolTWidth;
thYPos = e.pageY - toolTHeight > 6 ? e.pageY + pYScroll - toolTHeight - 7 : mYPos + pYScroll;
$("p#toltip").
css("top", thXPos + "px").
css("left", thYPos + "px").
fadeIn("fast");
}, function(){
$("p#toltip").fadeOut("fast");
});
Se funziona dovrai tradurre il codice in jquerese…