PDA

View Full Version : Text Info Pop-Up


Ninkasi
05-25-2004, 01:27 AM
Hey Peeps!

Have you ever been to a site that has words that you don't really know what they are, but when you scroll your mouse over them, a tool-tip type thing pops up and tells you what that words means?

How would I do that??

Cheers!

Willy Duitt
05-25-2004, 02:29 AM
<span style="cursor:help" onmouseover="this.setAttribute('title','Peeps means People')">Peeps</span>

Ninkasi
05-25-2004, 02:32 AM
Thanks Willy! :D

Willy Duitt
05-25-2004, 02:37 AM
UR Welcome;

BTW: Actually, you only need to use the title attribute.
Since I was in the clientside forum, I was thinking in javascript when I wrote that. :o

<span style="cursor:help" title="Peeps means People">Peeps</span>

Ninkasi
05-25-2004, 02:41 AM
Oh, ok then. I have seen it done with java script, but I couldn't find that code again.

Thanks again!

Willy Duitt
05-25-2004, 03:14 AM
For accessiblity, I use setAttribute() to provide two different tooltips. One for those with javascript disabled and another for javascript enabled.


<a href="http://google.com" title="Go to Google" onclick="popWindow(this.href)"
onmouseover="this.setAttribute('title','This will open Google\nin a popup window')">Google</a>

Ninkasi
05-25-2004, 10:26 PM
Those are just what I need. You're a champ Willy! :P