views:

42

answers:

4

I'd like to display a little tooltip similar to this:

alt text

That little black box appears when I put my mouse over it. How can I achieve this? Is it using jQuery or MooTools or what?

Thanks from this beginnig web designer!

+1  A: 

This is done through JavaScript. I would recommend using the jQuery framework, as there are a load of different jQuery Tool Tip plug-ins ready for you to use.

For example.

Moses
+2  A: 

I think you can do it with CSS. The black box can be an absolutely positioned child with display: none and on :hover you can show it.

bazmegakapa
I've never used CSS only tool-tips before, but I imagine that they won't degrade nicely on legacy browsers (IE6,IE7).
Moses
+1 for remembering things can be clever, but let me remind you that too clever designers are too clever by half, often enough. Don't be too clever. ;)
drachenstern
@Moses: The good thing is, I'm completely going to disregard the older browser, in fact I'm going to put a nice display up so users can use a good browser. "You can view this site but it won't work with old browser. Here use this instead."
Serg
IE7 is not a problem here (with the right doctype), only IE6. It only supports :hover on links. But if you want to support it, there are workarounds.
bazmegakapa
A: 

With jQuery, assuming you had a div properly formatted like thus: (notice this is an extremely simple example. I'm not defining the classes to properly format the elements or anything like that)

<a href="AcornsUsage.html" class="acornsremaining">3</a>

and

<div class="onmouseoverpopup parent">
 <div class="onmouesoverpopup arrowontopmiddle"></div>
 <div class="onmouesoverpopup text">Acorns remaining</div>
</div>

You might do something like this

$(document).ready( function() {
  $("acornsremaining").hover( function() {
    $("onmouseoverpopup.parent").show();
  }, function() { 
    $("onmouseoverpopup.parent").hide();
  });
});
drachenstern
A: 

Definitely looks like Tipsy, a jQuery plugin I used.

Chouchenos