Focus in CSS, not JavaScript. First create your popup in static HTML the way you want it to look when it is active. Then hide it and use .fadeIn() in jQuery.
I would try something like this:
<a href="foo.htm" class="tooltip"> Foo <div>Tooltip content</div> </a>
CSS
a.tooltip { position: relative; } a.tooltip > div { display: none; position: absolute; bottom: 100%; left: 50%; margin-left: -150px; width: 300px; }
JavaScript:
$("a.tooltip").hover(function () { $("> div", this).fadeIn(); }, function () { $("> div", this).fadeOut(); });
Edit: Here is a demo: http://jsfiddle.net/gilly3/b3PjW/ . I am returning the part that JavaScript is not the difficult part. Considering links around the edges of the screen means a lot of positioning logic. My jsfiddle does a bit, but does not take into account scrollbars or vertical positioning. This may or may not be a problem for you. If so, a good plugin should do everything for you.
source share