PDA

View Full Version : Cool DHTML Tooltip - Need help with text format



sweetpeakate
02-09-2006, 03:21 PM
Sorry, I realize that this is probably a very newb question
but is there any way to format the text that you want to appear in the tooltip?

For example, I would like the tooltip to read somewhat like this:

Welcome to my tooltip
1. It's useful
2. It's informative
3. Everybody likes it!

Any suggestions would be greatly appreciated.

jscheuer1
02-09-2006, 07:24 PM
See this thread (http://www.dynamicdrive.com/forums/showthread.php?p=26761#post26761).

Also, after that, have a look at this:


(snip) . . .
}
}

document.onmousemove=positiontip

//added defined tips:
var tipOne='<ul style="margin-bottom:0;margin-top:0;"><li>Art Directory Twenty One</li><li>About</li><li>Contact Us</li></ul>'

var tipTwo='<pre style="margin:0;font-family:verdana, arial, sans serif;font-size:14px;">Welcome to my tooltip\n\
1. It\'s useful\n\
2. It\'s informative\n\
3. Everybody likes it!</pre>'
</script>

<a href="http://www.yahoo.com" onMouseover="ddrivetip('Visit Yahoo.com')";
onMouseout="hideddrivetip()">Search Engine</a>

<br><span style="cursor:default;" onMouseover="ddrivetip(tipOne, '#EFEFEF', 225)";
onMouseout="hideddrivetip()">Planned Items</span><br>

<a href="http://yahoo.com" onMouseover="ddrivetip(tipTwo, 'yellow', 200)";
onMouseout="hideddrivetip()">Yahoo</a>

</body>

sweetpeakate
02-10-2006, 06:53 PM
Thanks for your help, John!

The code worked great with a few easy modifications. I'm using the tooltip whenever a user mouses over an entire cell on a table.

It was definitely a "d'oh" moment when I saw your code. Thanks again!

Sandi